Пример #1
0
    def test_dump_scope(self):
        scp = Scope(self.scope_file)
        dumped = scp.dump()
        # print("="*40)
        # print(dumped)
        # print("="*40)
        loaded = Scope(scope_def=dumped, scope_file="fake/filename.yaml")
        assert loaded == scp  # filename is intentionally different but let it go
        # but everything else is the same
        assert loaded.name == scp.name
        assert loaded.get_measures() == scp.get_measures()
        assert loaded.get_parameters() == scp.get_parameters()
        assert loaded.scope_file != scp.scope_file
        assert loaded.scope_file == "fake/filename.yaml"

        # fix name, still get equality
        loaded.scope_file = scp.scope_file
        assert loaded == scp
Пример #2
0
 def test_null_scope(self):
     scp = Scope(None)
     assert repr(scp) == "<emat.Scope with no content>"
     assert len(scp.get_measures()) == 0
     assert len(scp.get_parameters()) == 0