def test_equality(self, shot_type):
        a = ShotData(self.cover_uri, self.mds_url, self.shot_text, shot_type)
        b = ShotData('', self.mds_url, self.shot_text, shot_type)
        c = ShotData(self.cover_uri, '', self.shot_text, shot_type)
        d = ShotData(self.cover_uri, self.mds_url, self.shot_text, shot_type)

        assert a != b != c != d
        assert hash(a) != hash(b) != hash(c) != hash(d)
        assert a is not b is not c is not d

        assert a == d
        assert hash(a) == hash(d)
示例#2
0
def shot_data(shot_type):
    return ShotData(TestShotData.cover_uri, TestShotData.mds_url, TestShotData.shot_text, shot_type)