Skip to content

Commit 923622a

Browse files
authored
Merge pull request #460 from shivapbhusal/master
add unit test to prove the behaviour for string equality
2 parents dc0b808 + 99f2a8a commit 923622a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_future/test_str.py

+13
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,19 @@ def test_eq(self):
363363
self.assertFalse(b'ABCD' == s)
364364
self.assertFalse(bytes(b'ABCD') == s)
365365

366+
class OurCustomString(object):
367+
def __init__(self, string):
368+
self.string = string
369+
370+
def __str__(self):
371+
return self.string
372+
373+
our_str = OurCustomString("foobar")
374+
new_str = str("foobar")
375+
376+
self.assertFalse(our_str == new_str)
377+
self.assertFalse(new_str == our_str)
378+
366379
def test_hash(self):
367380
s = str('ABCD')
368381
self.assertIsInstance(hash(s),int)

0 commit comments

Comments
 (0)