Exemplo n.º 1
0
 def test_version_command(self, capsys):
     cli.main(['version'])
     out, err = capsys.readouterr()
     assert out == '{}\n'.format(cli.VERSION)
Exemplo n.º 2
0
 def test_ls_command(self, ls_command):
     cli.main(['ls', 'foo'])
     assert ls_command.call_count == 1
Exemplo n.º 3
0
 def test_timestamps(self, basicConfig, loglevel):
     cli.main(['--timestamps', '--log-level', loglevel, 'version'])
     assert basicConfig.call_args[1]['format'].startswith('%(asctime)s: ')
Exemplo n.º 4
0
 def test_debug_loglevel(self, basicConfig):
     cli.main(['--log-level=DEBUG', 'version'])
     assert basicConfig.call_args[1]['format'].startswith(
         '%(levelname)s:%(module)s')
     assert basicConfig.call_args[1]['level'] == 'DEBUG'
Exemplo n.º 5
0
 def test_rm_command(self, rm_command):
     cli.main(['rm', 'foo'])
     assert rm_command.call_count == 1
Exemplo n.º 6
0
 def test_debug_loglevel(self, basicConfig):
     cli.main(["--log-level=DEBUG", "version"])
     assert basicConfig.call_args[1]["format"].startswith("%(levelname)s:%(module)s")
     assert basicConfig.call_args[1]["level"] == "DEBUG"
Exemplo n.º 7
0
 def test_targets_command(self, TargetsCommand, command):
     cli.main([command])
     assert TargetsCommand.call_count == 1
Exemplo n.º 8
0
 def test_edit_command(self, edit_command):
     cli.main(['edit', 'foo'])
     assert edit_command.call_count == 1
Exemplo n.º 9
0
 def test_sync_command(self, SyncCommand, command):
     cli.main([command, "foo"])
     assert SyncCommand.call_count == 1
Exemplo n.º 10
0
 def test_edit_command(self, EditCommand, command):
     cli.main([command, "foo"])
     assert EditCommand.call_count == 1
Exemplo n.º 11
0
 def test_daemon_command(self, DaemonCommand, command):
     cli.main([command])
     assert DaemonCommand.call_count == 1
Exemplo n.º 12
0
 def test_ls_command(self, LsCommand):
     cli.main(["ls", "foo"])
     assert LsCommand.call_count == 1
Exemplo n.º 13
0
 def test_version_command(self, capsys, command):
     cli.main([command])
     out, err = capsys.readouterr()
     assert out == "{}\n".format(cli.VERSION)
Exemplo n.º 14
0
 def test_daemon_command(self, daemon_command):
     cli.main(['daemon'])
     assert daemon_command.call_count == 1
Exemplo n.º 15
0
 def test_rm_command(self, RmCommand):
     cli.main(["rm", "foo"])
     assert RmCommand.call_count == 1
Exemplo n.º 16
0
 def test_sync_command(self, sync_command):
     cli.main(['sync', 'foo'])
     assert sync_command.call_count == 1
Exemplo n.º 17
0
 def test_add_command(self, AddCommand, command):
     cli.main([command])
     assert AddCommand.call_count == 1
Exemplo n.º 18
0
 def test_targets_command(self, targets_command):
     cli.main(['targets'])
     assert targets_command.call_count == 1
Exemplo n.º 19
0
 def test_no_arguments_prints_help(self, print_help):
     cli.main([])
     assert print_help.call_count == 1
Exemplo n.º 20
0
 def test_add_command(self, add_command):
     cli.main(['add'])
     assert add_command.call_count == 1
Exemplo n.º 21
0
 def test_timestamps(self, basicConfig, loglevel):
     cli.main(["--timestamps", "--log-level", loglevel, "version"])
     assert basicConfig.call_args[1]["format"].startswith("%(asctime)s: ")