Example #1
0
 def test_args(self):
     with patch("ttt.monitor.create_monitor", autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert "watch_path" in args
         assert kwargs["build_path"] == "buildpath"
         assert kwargs["generator"] == "Ninja"
         assert kwargs["define"] is None
Example #2
0
 def test_args(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert 'watch_path' in args
         assert kwargs['build_path'] == 'buildpath'
         assert kwargs['generator'] == 'Ninja'
         assert kwargs['define'] is None
Example #3
0
 def test_irc_enabled(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert 'irc_server' in kwargs
         assert kwargs['irc_server'] == 'testserver'
         assert kwargs['irc_port'] == 6666
         assert kwargs['irc_channel'] == '#test'
         assert kwargs['irc_nick'] == 'testtest'
Example #4
0
 def test_irc_enabled(self):
     with patch("ttt.monitor.create_monitor", autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert "irc_server" in kwargs
         assert kwargs["irc_server"] == "testserver"
         assert kwargs["irc_port"] == 6666
         assert kwargs["irc_channel"] == "#test"
         assert kwargs["irc_nick"] == "testtest"
Example #5
0
 def test_exclusion_list(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert kwargs['exclude'] == ['*.o', 'blah']
Example #6
0
 def test_exclusion_list(self):
     with patch("ttt.monitor.create_monitor", autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert kwargs["exclude"] == ["*.o", "blah"]
Example #7
0
 def test_patterns(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert args == ('watch_path', set(['file1', 'file2']))
Example #8
0
 def test_irc_disabled(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert kwargs['irc_server'] is None
Example #9
0
 def test_define_list(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert kwargs['define'] == ['test=y', 'foo=bar']
Example #10
0
 def test_verbosity_none(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor: # noqa
         cli.run()
     assert Terminal.VERBOSITY == 0
Example #11
0
 def test_clean(self):
     with patch("ttt.monitor.create_monitor", autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert kwargs["clean"]
Example #12
0
 def test_no_args(self):
     with patch("ttt.monitor.create_monitor",
                autospec=True) as monitor:  # noqa
         with pytest.raises(SystemExit):
             cli.run()
Example #13
0
def main():
    if sys.stdout.isatty():
        colorama.init()
    cli.run()
    sys.exit(0)
Example #14
0
 def test_irc_disabled(self):
     with patch("ttt.monitor.create_monitor", autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert kwargs["irc_server"] is None
Example #15
0
 def test_patterns(self):
     with patch("ttt.monitor.create_monitor", autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert args == ("watch_path", set(["file1", "file2"]))
Example #16
0
 def test_verbosity_none(self):
     with patch("ttt.monitor.create_monitor",
                autospec=True) as monitor:  # noqa
         cli.run()
     assert Terminal.VERBOSITY == 0
Example #17
0
 def test_define_list(self):
     with patch("ttt.monitor.create_monitor", autospec=True) as monitor:
         cli.run()
         assert len(monitor.call_args_list)
         args, kwargs = monitor.call_args_list[0]
         assert kwargs["define"] == ["test=y", "foo=bar"]
Example #18
0
def main():
    if sys.stdout.isatty():
        colorama.init()
    cli.run()
    sys.exit(0)
Example #19
0
 def test_no_args(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor: # noqa
         with pytest.raises(SystemExit):
             cli.run()