Пример #1
0
 def test_invalid(self):
     self.assertFalse(check_ref_format(b"foo"))
     self.assertFalse(check_ref_format(b"heads/foo/"))
     self.assertFalse(check_ref_format(b"./foo"))
     self.assertFalse(check_ref_format(b".refs/foo"))
     self.assertFalse(check_ref_format(b"heads/foo..bar"))
     self.assertFalse(check_ref_format(b"heads/foo?bar"))
     self.assertFalse(check_ref_format(b"heads/foo.lock"))
     self.assertFalse(check_ref_format(b"heads/v@{ation"))
     self.assertFalse(check_ref_format(b"heads/foo\bar"))
Пример #2
0
 def test_invalid(self):
     self.assertFalse(check_ref_format(b'foo'))
     self.assertFalse(check_ref_format(b'heads/foo/'))
     self.assertFalse(check_ref_format(b'./foo'))
     self.assertFalse(check_ref_format(b'.refs/foo'))
     self.assertFalse(check_ref_format(b'heads/foo..bar'))
     self.assertFalse(check_ref_format(b'heads/foo?bar'))
     self.assertFalse(check_ref_format(b'heads/foo.lock'))
     self.assertFalse(check_ref_format(b'heads/v@{ation'))
     self.assertFalse(check_ref_format(b'heads/foo\bar'))
Пример #3
0
 def test_invalid(self):
     self.assertFalse(check_ref_format(b'foo'))
     self.assertFalse(check_ref_format(b'heads/foo/'))
     self.assertFalse(check_ref_format(b'./foo'))
     self.assertFalse(check_ref_format(b'.refs/foo'))
     self.assertFalse(check_ref_format(b'heads/foo..bar'))
     self.assertFalse(check_ref_format(b'heads/foo?bar'))
     self.assertFalse(check_ref_format(b'heads/foo.lock'))
     self.assertFalse(check_ref_format(b'heads/v@{ation'))
     self.assertFalse(check_ref_format(b'heads/foo\bar'))
Пример #4
0
 def test_invalid(self):
     self.assertFalse(check_ref_format(b"foo"))
     self.assertFalse(check_ref_format(b"heads/foo/"))
     self.assertFalse(check_ref_format(b"./foo"))
     self.assertFalse(check_ref_format(b".refs/foo"))
     self.assertFalse(check_ref_format(b"heads/foo..bar"))
     self.assertFalse(check_ref_format(b"heads/foo?bar"))
     self.assertFalse(check_ref_format(b"heads/foo.lock"))
     self.assertFalse(check_ref_format(b"heads/v@{ation"))
     self.assertFalse(check_ref_format(b"heads/foo\bar"))
Пример #5
0
 def test_valid(self):
     self.assertTrue(check_ref_format(b'heads/foo'))
     self.assertTrue(check_ref_format(b'foo/bar/baz'))
     self.assertTrue(check_ref_format(b'refs///heads/foo'))
     self.assertTrue(check_ref_format(b'foo./bar'))
     self.assertTrue(check_ref_format(b'heads/foo@bar'))
     self.assertTrue(check_ref_format(b'heads/fix.lock.error'))
Пример #6
0
 def test_valid(self):
     self.assertTrue(check_ref_format(b'heads/foo'))
     self.assertTrue(check_ref_format(b'foo/bar/baz'))
     self.assertTrue(check_ref_format(b'refs///heads/foo'))
     self.assertTrue(check_ref_format(b'foo./bar'))
     self.assertTrue(check_ref_format(b'heads/foo@bar'))
     self.assertTrue(check_ref_format(b'heads/fix.lock.error'))
Пример #7
0
 def test_valid(self):
     self.assertTrue(check_ref_format(b"heads/foo"))
     self.assertTrue(check_ref_format(b"foo/bar/baz"))
     self.assertTrue(check_ref_format(b"refs///heads/foo"))
     self.assertTrue(check_ref_format(b"foo./bar"))
     self.assertTrue(check_ref_format(b"heads/foo@bar"))
     self.assertTrue(check_ref_format(b"heads/fix.lock.error"))
Пример #8
0
 def test_valid(self):
     self.assertTrue(check_ref_format(b"heads/foo"))
     self.assertTrue(check_ref_format(b"foo/bar/baz"))
     self.assertTrue(check_ref_format(b"refs///heads/foo"))
     self.assertTrue(check_ref_format(b"foo./bar"))
     self.assertTrue(check_ref_format(b"heads/foo@bar"))
     self.assertTrue(check_ref_format(b"heads/fix.lock.error"))
Пример #9
0
    def check_ref_format(self, refname: str):
        from dulwich.refs import check_ref_format

        return check_ref_format(refname.encode())