| |
@@ -15,8 +15,9 @@
|
| |
@pytest.mark.needs_metadata
|
| |
class TestModuleSummary(object):
|
| |
|
| |
- def matches(self, mod, strm, prof, out):
|
| |
- return re.search(fr'^{mod}\s+{strm}\s+{prof}$', out, re.M) is not None
|
| |
+ def matches(self, mod, strm, ver, ctxt, prof, deps, out):
|
| |
+ mstr = fr'^{mod}\s+{strm}\s+{ver}\s+{ctxt}\s+{prof}\s+{deps}$'
|
| |
+ return re.search(mstr, out, re.M) is not None
|
| |
|
| |
# FIXME: we should mock the fetched metadata so that these tests do not
|
| |
# fail when the metadata changes
|
| |
@@ -24,33 +25,40 @@
|
| |
summarize_modules()
|
| |
out, err = capfd.readouterr()
|
| |
|
| |
- assert self.matches('reviewboard', '2.5',
|
| |
- r'server, default \[d\]',
|
| |
- out)
|
| |
- assert self.matches('reviewboard', '3.0',
|
| |
- r'server, default \[d\]',
|
| |
- out)
|
| |
- assert self.matches('testmodule', 'master', 'default', out)
|
| |
+ assert self.matches('reviewboard', '2.5', '20180828143308', '083bce86',
|
| |
+ r'default \[d\], server',
|
| |
+ 'django:1.6,platform:f29', out)
|
| |
+ assert self.matches('reviewboard', '3.0', '20180828143238', '083bce86',
|
| |
+ r'default \[d\], server',
|
| |
+ 'django:1.6,platform:f29', out)
|
| |
+ assert self.matches('testmodule', 'master', '20180405123256',
|
| |
+ 'c2c572ec', 'default', 'platform:f29', out)
|
| |
|
| |
def test_summarize_modules_restricted(self, capfd):
|
| |
summarize_modules(['reviewboard', 'django'])
|
| |
out, err = capfd.readouterr()
|
| |
|
| |
- assert self.matches('reviewboard', '2.5',
|
| |
- r'server, default \[d\]',
|
| |
- out)
|
| |
- assert self.matches('reviewboard', '3.0',
|
| |
- r'server, default \[d\]',
|
| |
- out)
|
| |
- assert self.matches('django', '1.6',
|
| |
- r'python2_development, default \[d\]',
|
| |
- out)
|
| |
- assert not self.matches('testmodule', 'master', 'default', out)
|
| |
+ assert self.matches('reviewboard', '2.5', '20180828143308', '083bce86',
|
| |
+ r'default \[d\], server',
|
| |
+ 'django:1.6,platform:f29', out)
|
| |
+ assert self.matches('reviewboard', '3.0', '20180828143238', '083bce86',
|
| |
+ r'default \[d\], server',
|
| |
+ 'django:1.6,platform:f29', out)
|
| |
+ assert self.matches('django', '1.6', '20180828135711', '6c81f848',
|
| |
+ r'default \[d\], python2_development',
|
| |
+ 'platform:f29', out)
|
| |
+ assert not self.matches('testmodule', 'master', '20180405123256',
|
| |
+ 'c2c572ec', 'default', 'platform:f29', out)
|
| |
|
| |
def test_summarize_modules_local_files(self, capfd):
|
| |
summarize_modules(yaml_files=[spec_v2_yaml_path])
|
| |
out, err = capfd.readouterr()
|
| |
|
| |
- assert self.matches('testmodule', 'master', 'default', out)
|
| |
- assert self.matches('foo', 'stream-name', 'minimal, buildroot, ' +
|
| |
- 'container, srpm-buildroot, default', out)
|
| |
+ assert self.matches('testmodule', 'master', '20180405123256',
|
| |
+ 'c2c572ec', 'default', 'platform:f29', out)
|
| |
+ assert self.matches('foo', 'stream-name', '20160927144203', 'c0ffee43',
|
| |
+ 'buildroot, container, default, minimal, ' +
|
| |
+ 'srpm-buildroot', 'compatible:v3,v4,extras,' +
|
| |
+ 'moreextras:bar,foo,platform:-epel7,-f27,-f28,' +
|
| |
+ 'platform:epel7,platform:f27,platform:f28,' +
|
| |
+ 'runtime:a,b', out)
|
| |