MCPcopy Create free account
hub / github.com/wal-e/wal-e / test_version_print

Function test_version_print

tests/test_cmdline_version.py:8–26  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6
7
8def test_version_print():
9 # Load up the contents of the VERSION file out-of-band
10 from wal_e import cmd
11 place = path.join(path.dirname(cmd.__file__), 'VERSION')
12 with open(place, 'rb') as f:
13 expected = f.read()
14
15 # Try loading it via command line invocation
16 try:
17 proc = subprocess.Popen(['wal-e', 'version'], stdout=subprocess.PIPE)
18 except EnvironmentError as e:
19 if e.errno == errno.ENOENT:
20 pytest.skip('wal-e must be in $PATH to test version output')
21 result = proc.communicate()[0]
22
23 # Make sure the two versions match and the command exits
24 # successfully.
25 assert proc.returncode == 0
26 assert result == expected

Callers

nothing calls this directly

Calls 2

joinMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected