Beispiel #1
0
def test_tide_can_start_and_returns_json(capsys):
    from tide import Tide
    tide_object = Tide()
    tide_object.start()
    capture = capsys.readouterr()
    tide_object.stop()
    assert len(capture) == 2
Beispiel #2
0
 def test_tide_can_start_and_has_9_lines(self, capsys):
     from tide import Tide
     tide_object = Tide()
     tide_object.start()
     tide_object.stop()
     capture = capsys.readouterr()
     out_string = capture.out
     assert len(out_string.split("\n")) == 9
def test__run_command_with_match_on_hex():
    try:
        tide_handler = Tide('test_mock')
        tide_handler.start()
        tide_handler.run_config_command("test_command")
        result = Config().get_variable("test_match_variable")
        tide_handler.stop()
        assert result == '0x00001234abcd'
    except Exception as ex:
        pytest.fail("error in filter tests: " + str(ex))
Beispiel #4
0
def test__run_command_with_match_on_array():
    try:
        tide_handler = Tide()
        tide_handler.start()
        tide_handler.run_config_command("test_command")
        result = Config().get_variable("test_match_array")
        tide_handler.stop()
        assert '0x00001234abce' in result
        assert '0x000000009876' in result
    except Exception as ex:
        pytest.fail("error in filter tests: " + str(ex))
Beispiel #5
0
 def test_tide_can_start_and_config_dictionary_has_internal_key(self, capsys):
     from tide import Tide
     tide_object = Tide()
     tide_object.start()
     tide_object.stop()
     capture = capsys.readouterr()
     out_string = capture.out
     out_strings = out_string.split("\n")
     json_string = out_strings[0]
     json_object = json.loads(json_string)
     assert "internal" in json_object["command"]["value"]["config_dictionary"].keys()
Beispiel #6
0
 def test_tide_can_start_and_has_json_object_with_command_key(self, capsys):
     from tide import Tide
     tide_object = Tide()
     tide_object.start()
     tide_object.stop()
     capture = capsys.readouterr()
     out_string = capture.out
     out_strings = out_string.split("\n")
     json_string = out_strings[0]
     json_object = json.loads(json_string)
     assert "command" in json_object.keys()
Beispiel #7
0
 def test_tide_can_start_and_has_json_object(self, capsys):
     from tide import Tide
     tide_object = Tide()
     tide_object.start()
     tide_object.stop()
     capture = capsys.readouterr()
     out_string = capture.out
     out_strings = out_string.split("\n")
     json_string = out_strings[0]
     json_object = json.loads(json_string)
     assert(isinstance(json_object, dict))
Beispiel #8
0
def test_tide_can_start():
    tide_object = Tide()
    tide_object.start()
    tide_object.stop()
    assert type(tide_object) == type(Tide())