Git Product home page Git Product logo

Comments (3)

aaaaalbert avatar aaaaalbert commented on September 16, 2024

@karthikgvss will take a look at this issuel

from seattlelib_v2.

karthikgvss avatar karthikgvss commented on September 16, 2024

I see that tcp_time will set a mapping by calling time_register_method
time_interface.r2py will use the update method of this implementor as per the mapping. So, i think we need not change anything in ut_seattlelib_tcptime.py

similarly, for ut_seattlelib_ntptime.py, time_interface.r2py has to be called instead of time.r2py as we are testing only ntp here. Also, port has to be determined by calling list(getresources()[0]["connport"])[0] instead of hard coding 12345. Please suggest.

from seattlelib_v2.

vladimir-v-diaz avatar vladimir-v-diaz commented on September 16, 2024

I find the interaction between these modules a little surprising. It is not immediately obvious that importing tcp_time.r2py causes the behavior of time_interface.r2py to change. So these time modules are essentially performing actions on import? If this is what we really want, maybe state this side effect more clearly in the header block. Registering "tcp" time in tcp_time.r2py by calling time_interface.time_register_method() at the end of the module (i.e., the action on import) might also be a readability problem:

https://github.com/SeattleTestbed/seattlelib_v2/blob/master/tcp_time.r2py#L123-L124
Note: But I do understand that it's done this way because the tcp_time_updatetime() function needs to be defined..

What happens if we import both tcp_time.r2py and ntp_time.r2py? What if another module imports them separately, for example if these unit tests are executed in a testing framework? Or there is a circular import? I'm assuming time_interface.r2py would choose one of the available time functions and these unit tests would pass if at least one of the registered methods is successful. In other words, is it possible for this unit test to pass if ntp_time.r2py is registered beforehand and the registered tcp time module is not called at all?

from seattlelib_v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.