Exemplo n.º 1
0
    def test_taxes(self, capsys, event_loop):
        # --help
        sys.argv = ['fake', 'montreal', 'taxes', '-t', 'municipal']

        main()
        out, err = capsys.readouterr()

        assert 'Next municipal taxes for' in out
        assert '' == err
Exemplo n.º 2
0
 def test_taxes(self, capsys, event_loop):
     # pymycity -c 1 mascouche taxes -t municipal
     sys.argv = [
         'pymycity', '-c', '1', 'mascouche', 'taxes', '-t', 'municipale'
     ]
     main()
     out, err = capsys.readouterr()
     assert 'Next municipale taxes for' in out
     assert '' == err
Exemplo n.º 3
0
 def test_garbage(self, capsys, event_loop):
     # pymycity -a garbage_collection taxes -t waste
     sys.argv = [
         'pymycity', '-a', 'mascouche', 'garbage_collection', '-t',
         'déchets'
     ]
     main()
     out, err = capsys.readouterr()
     assert 'Next déchets collection for' in out
     assert '' == err
Exemplo n.º 4
0
 def test_event(self, capsys, event_loop):
     # pymycity garbage_collection events
     sys.argv = ['pymycity', 'mascouche', 'events']
     main()
     out, err = capsys.readouterr()
     assert 'Next all events for' in out
     assert '' == err
     # pymycity garbage_collection events
     sys.argv = ['pymycity', 'mascouche', 'events', '-t', 'Bibliothèque']
     main()
     out, err = capsys.readouterr()
     assert 'Next Bibliothèque events for' in out
     assert '' == err
Exemplo n.º 5
0
 def test_help(self, capsys):
     # pymycity
     sys.argv = ['pymycity']
     main()
     out, err = capsys.readouterr()
     assert 'usage: ' in out
     assert '' == err
     # pymycity --help
     sys.argv = ['pymycity', '--help']
     with pytest.raises(SystemExit):
         main()
     out, err = capsys.readouterr()
     assert 'usage: ' in out
     assert '' == err
     # pymycity mascouche
     sys.argv = ['pymycity', 'mascouche']
     main()
     out, err = capsys.readouterr()
     assert 'usage:' in out
     assert '' == err