def test_invalid_refname(self): text = _TEST_REFS_SERIALIZED + b'00' * 20 + b'\trefs/stash\n' refs = InfoRefsContainer(BytesIO(text)) expected_refs = dict(_TEST_REFS) del expected_refs[b'HEAD'] expected_refs[b'refs/stash'] = b'00' * 20 self.assertEqual(expected_refs, refs.as_dict())
def test_as_dict(self): refs = InfoRefsContainer(BytesIO(_TEST_REFS_SERIALIZED)) # refs/heads/loop does not show up even if it exists expected_refs = dict(_TEST_REFS) del expected_refs[b'HEAD'] del expected_refs[b'refs/heads/loop'] self.assertEqual(expected_refs, refs.as_dict())
def test_invalid_refname(self): text = _TEST_REFS_SERIALIZED + '00' * 20 + '\trefs/stash\n' refs = InfoRefsContainer(StringIO(text)) expected_refs = dict(_TEST_REFS) del expected_refs['HEAD'] expected_refs["refs/stash"] = "00" * 20 self.assertEqual(expected_refs, refs.as_dict())
def test_invalid_refname(self): text = _TEST_REFS_SERIALIZED + b"00" * 20 + b"\trefs/stash\n" refs = InfoRefsContainer(BytesIO(text)) expected_refs = dict(_TEST_REFS) del expected_refs[b"HEAD"] expected_refs[b"refs/stash"] = b"00" * 20 self.assertEqual(expected_refs, refs.as_dict())
def test_invalid_refname(self): text = _TEST_REFS_SERIALIZED + b"00" * 20 + b"\trefs/stash\n" refs = InfoRefsContainer(BytesIO(text)) expected_refs = dict(_TEST_REFS) del expected_refs[b"HEAD"] expected_refs[b"refs/stash"] = b"00" * 20 del expected_refs[b"refs/heads/loop"] self.assertEqual(expected_refs, refs.as_dict())