Beispiel #1
0
 def test_inconsistent_config(self):
     state = {"cxxflags": "new_flag"}
     
     try:
         _check_state(None, state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True
Beispiel #2
0
 def test_inconsistent_config(self):
     state = {"cxxflags": "new_flag"}
     
     try:
         _check_state(None, state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True
Beispiel #3
0
    def test_missing_calling_fkt(self, config_state):
        config_state["main"] = dummy.__name__
        config_state["called"] = {}
        _check_state(dummy, config_state)
        
        config_state["called"]["called1"] = "hash"
        try:
            _check_state(dummy, config_state)
            pytest.fail("Config is inconsistent")
        except LookupError as le:
            assert True

        config_state["called"].pop("called1")
        config_state["called"][dummy_called.__name__] = "hash"
        try:
            _check_state(dummy, config_state)
            pytest.fail("Config is inconsistent")
        except LookupError as le:
            assert True

        config_state["called"].pop(dummy_called.__name__)
        config_state["called"][_check_state.__name__] = "hash"
        try:
            _check_state(dummy, config_state)
            pytest.fail("Config is inconsistent")
        except LookupError as le:
            assert True
Beispiel #4
0
    def test_missing_calling_fkt(self, config_state):
        config_state["main"] = dummy.__name__
        config_state["called"] = {}
        _check_state(dummy, config_state)
        
        config_state["called"]["called1"] = "hash"
        try:
            _check_state(dummy, config_state)
            pytest.fail("Config is inconsistent")
        except LookupError as le:
            assert True

        config_state["called"].pop("called1")
        config_state["called"][dummy_called.__name__] = "hash"
        try:
            _check_state(dummy, config_state)
            pytest.fail("Config is inconsistent")
        except LookupError as le:
            assert True

        config_state["called"].pop(dummy_called.__name__)
        config_state["called"][_check_state.__name__] = "hash"
        try:
            _check_state(dummy, config_state)
            pytest.fail("Config is inconsistent")
        except LookupError as le:
            assert True
Beispiel #5
0
 def test_no_fkt_in_state(self, config_state):
     try:
         _check_state(None, config_state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True
         
     config_state["main"] = "fkt_name"
     try:
         _check_state(None, config_state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True
         
     config_state["called"] = "called_fkt_name"
     try:
         _check_state(dummy, config_state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True
Beispiel #6
0
 def test_no_fkt_in_state(self, config_state):
     try:
         _check_state(None, config_state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True
         
     config_state["main"] = "fkt_name"
     try:
         _check_state(None, config_state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True
         
     config_state["called"] = "called_fkt_name"
     try:
         _check_state(dummy, config_state)
         pytest.fail("Config is inconsistent")
     except LookupError as le:
         assert True