Exemple #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
Exemple #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
Exemple #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'
Exemple #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"
Exemple #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']
Exemple #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"]
Exemple #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']))
Exemple #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
Exemple #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']
Exemple #10
0
 def test_verbosity_none(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor: # noqa
         cli.run()
     assert Terminal.VERBOSITY == 0
Exemple #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"]
Exemple #12
0
 def test_no_args(self):
     with patch("ttt.monitor.create_monitor",
                autospec=True) as monitor:  # noqa
         with pytest.raises(SystemExit):
             cli.run()
Exemple #13
0
def main():
    if sys.stdout.isatty():
        colorama.init()
    cli.run()
    sys.exit(0)
Exemple #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
Exemple #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"]))
Exemple #16
0
 def test_verbosity_none(self):
     with patch("ttt.monitor.create_monitor",
                autospec=True) as monitor:  # noqa
         cli.run()
     assert Terminal.VERBOSITY == 0
Exemple #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"]
Exemple #18
0
def main():
    if sys.stdout.isatty():
        colorama.init()
    cli.run()
    sys.exit(0)
Exemple #19
0
 def test_no_args(self):
     with patch('ttt.monitor.create_monitor', autospec=True) as monitor: # noqa
         with pytest.raises(SystemExit):
             cli.run()