diff options
| author | Marco Capitani <m.capitani@nextworks.it> | 2017-04-11 15:07:51 +0200 | 
|---|---|---|
| committer | Marco Capitani <m.capitani@nextworks.it> | 2017-04-11 15:07:51 +0200 | 
| commit | 7f5054816fc68bca1d9d4901d1e365b57a278542 (patch) | |
| tree | 7328ab2edb7808fe9eb405be73c09c20f82be035 | |
| parent | a7fbb7237f63c4c0d09cfd35c93fbe2e126bc471 (diff) | |
| download | rumba-7f5054816fc68bca1d9d4901d1e365b57a278542.tar.gz rumba-7f5054816fc68bca1d9d4901d1e365b57a278542.zip  | |
Testing method fix
| -rw-r--r-- | rumba/model.py | 10 | ||||
| -rw-r--r-- | rumba/prototypes/irati.py | 4 | 
2 files changed, 6 insertions, 8 deletions
diff --git a/rumba/model.py b/rumba/model.py index 4a9a1be..bab92bf 100644 --- a/rumba/model.py +++ b/rumba/model.py @@ -298,9 +298,7 @@ class ShimUDPIPCP(IPCP):  # @nodes: Nodes in the experiment  #  class Experiment: -    def __init__(self, testbed, nodes=None, config_file=None): -        if config_file: -            nodes = self.read_config_file(config_file) +    def __init__(self, testbed, nodes=None):          if nodes is None:              nodes = list()          self.nodes = nodes @@ -312,8 +310,8 @@ class Experiment:          # Generate missing information          self.generate() -    @staticmethod -    def read_config_file(filename='demo.conf'): +    @classmethod +    def from_config_file(cls, testbed, filename='demo.conf'):          """          :type testbed: Testbed           :param testbed: the testbed for the experiment @@ -408,7 +406,7 @@ class Experiment:                                   for x, l in node_data['dif_registrations'].items()}              parsed_nodes.append(Node(name, difs, dif_registrations)) -        return parsed_nodes +        return cls(testbed=testbed, nodes=parsed_nodes)      def __repr__(self):          s = "" diff --git a/rumba/prototypes/irati.py b/rumba/prototypes/irati.py index df963c5..c4c30c7 100644 --- a/rumba/prototypes/irati.py +++ b/rumba/prototypes/irati.py @@ -26,8 +26,8 @@ import rumba.prototypes.irati_templates as irati_templates  # An experiment over the IRATI implementation  class Experiment(mod.Experiment): -    def __init__(self, testbed, nodes=None, config_file=None): -        mod.Experiment.__init__(self, testbed, nodes, config_file) +    def __init__(self, testbed, nodes=None): +        mod.Experiment.__init__(self, testbed, nodes)      def setup(self):          cmds = list()  | 
