def test_expand(self): for source, expanded in self.expansions.items(): with self.subTest(source=source): self.assertEqual( base.NpmSpec(source).clause, base.NpmSpec(expanded).clause, )
def test_spec(self): for spec, lists in self.examples.items(): matching, failing = lists for version in matching: with self.subTest(spec=spec, version=version): self.assertIn(base.Version(version), base.NpmSpec(spec)) for version in failing: with self.subTest(spec=spec, version=version): self.assertNotIn(base.Version(version), base.NpmSpec(spec))