Exemplo n.º 1
0
 def test_replace_non_canonical(self):
     new_req = '-e file:///path#egg=foo_baz'
     reqs = requirement.parse("foo-baz===1.0.2\n")
     res = edit.edit(reqs, 'foo_baz', new_req)
     self.assertEqual(
         res,
         requirement.Requirements(
             [requirement.Requirement('', '', '', '', new_req)]))
Exemplo n.º 2
0
 def test_delete(self):
     reqs = requirement.parse('foo==1.2\n')
     res = edit.edit(reqs, 'foo', '')
     self.assertEqual(requirement.Requirements([]), res)
Exemplo n.º 3
0
 def test_replace_many(self):
     reqs = requirement.parse('foo==1.2;p\nfoo==1.3;q')
     res = edit.edit(reqs, 'foo', 'foo==1.3')
     self.assertEqual(
         requirement.Requirements(
             [requirement.Requirement('', '', '', '', 'foo==1.3')]), res)
Exemplo n.º 4
0
 def test_add(self):
     reqs = {}
     res = edit.edit(reqs, 'foo', 'foo==1.2')
     self.assertEqual(
         requirement.Requirements(
             [requirement.Requirement('', '', '', '', 'foo==1.2')]), res)
 def test_replace_non_canonical(self):
     new_req = '-e file:///path#egg=foo_baz'
     reqs = requirement.parse("foo-baz===1.0.2\n")
     res = edit.edit(reqs, 'foo_baz', new_req)
     self.assertEqual(res, requirement.Requirements(
         [requirement.Requirement('', '', '', '', new_req)]))
 def test_replace_many(self):
     reqs = requirement.parse('foo==1.2;p\nfoo==1.3;q')
     res = edit.edit(reqs, 'foo', 'foo==1.3')
     self.assertEqual(requirement.Requirements(
         [requirement.Requirement('', '', '', '', 'foo==1.3')]), res)
 def test_delete(self):
     reqs = requirement.parse('foo==1.2\n')
     res = edit.edit(reqs, 'foo', '')
     self.assertEqual(requirement.Requirements([]), res)
 def test_add(self):
     reqs = {}
     res = edit.edit(reqs, 'foo', 'foo==1.2')
     self.assertEqual(requirement.Requirements(
         [requirement.Requirement('', '', '', '', 'foo==1.2')]), res)