Exemplo n.º 1
0
 def test_version(self, capsys):
     with pytest.raises(SystemExit) as excinfo:
         parse_args(['-V'])
     assert excinfo.value.code == 0
     expected = "pi2graphite v%s <%s>\n" % (VERSION, PROJECT_URL)
     out, err = capsys.readouterr()
     if (sys.version_info[0] < 3
             or (sys.version_info[0] == 3 and sys.version_info[1] < 4)):
         assert out == ''
         assert err == expected
     else:
         assert out == expected
         assert err == ''
Exemplo n.º 2
0
 def test_verbose2(self):
     res = parse_args(['-vv'])
     assert res.verbose == 2
Exemplo n.º 3
0
 def test_config(self):
     res = parse_args(['--config=foo'])
     assert res.config == 'foo'
Exemplo n.º 4
0
 def test_example_config(self):
     res = parse_args(['--example-config'])
     assert res.example_config is True
Exemplo n.º 5
0
 def test(self):
     res = parse_args([])
     assert res.verbose == 0
     assert res.config == '/etc/pi2graphite.json'