def test_comments(self): data = { "count": 9, "name": "t1_cu5tt8h", "id": "cu5tt8h", "parent_id": "t3_3hahrw", "children": [ "cu5tt8h", "cu5v9yd", "cu5twf5", "cu5tkk4", "cu5tead", "cu5rxpy", "cu5oufs", "cu5tpek", "cu5pbdh", ], } with self.recorder.use_cassette( "TestMore.test_comments", match_requests_on=["uri", "method", "body"], ): more = MoreComments(self.reddit, data) more.submission = self.reddit.submission("3hahrw") assert len(more.comments()) == 7
def test_equality(self): more = MoreComments(self.reddit, {"children": ["a", "b", "c", "d"], "count": 4}) more2 = MoreComments( self.reddit, {"children": ["a", "b", "c", "d"], "count": 4} ) assert more == more2 assert more != 5
def test_repr(self): more = MoreComments( self.reddit, {"children": ["a", "b", "c", "d", "e"], "count": 5} ) assert repr(more) == "<MoreComments count=5, children=['a', 'b', 'c', '...']>" more = MoreComments(self.reddit, {"children": ["a", "b", "c", "d"], "count": 4}) assert repr(more) == "<MoreComments count=4, children=['a', 'b', 'c', 'd']>"
def test_comments__continue_thread_type(self): data = {'count': 0, 'name': 't1__', 'id': '_', 'parent_id': 't1_cu5v5h7', 'children': []} with self.recorder.use_cassette( 'TestMore.test_comments__continue_thread_type', match_requests_on=['uri', 'method', 'body']): more = MoreComments(self.reddit, data) more.submission = self.reddit.submission('3hahrw') assert len(more.comments()) == 1
def test_comments(self): data = {'count': 9, 'name': 't1_cu5tt8h', 'id': 'cu5tt8h', 'parent_id': 't3_3hahrw', 'children': [ 'cu5tt8h', 'cu5v9yd', 'cu5twf5', 'cu5tkk4', 'cu5tead', 'cu5rxpy', 'cu5oufs', 'cu5tpek', 'cu5pbdh']} with self.recorder.use_cassette( 'TestMore.test_comments', match_requests_on=['uri', 'method', 'body']): more = MoreComments(self.reddit, data) more.submission = self.reddit.submission('3hahrw') assert len(more.comments()) == 7
def test_comments__continue_thread_type(self): data = { "count": 0, "name": "t1__", "id": "_", "parent_id": "t1_cu5v5h7", "children": [], } with self.use_cassette(match_requests_on=["uri", "method", "body"]): more = MoreComments(self.reddit, data) more.submission = self.reddit.submission("3hahrw") assert len(more.comments()) == 1
def test_repr(self): more = MoreComments(self.reddit, { 'children': ['a', 'b', 'c', 'd', 'e'], 'count': 5 }) assert repr(more) == ("<MoreComments count=5, " "children=['a', 'b', 'c', '...']>") more = MoreComments(self.reddit, { 'children': ['a', 'b', 'c', 'd'], 'count': 4 }) assert repr(more) == ("<MoreComments count=4, " "children=['a', 'b', 'c', 'd']>")
def test_comments__continue_thread_type(self): data = { "count": 0, "name": "t1__", "id": "_", "parent_id": "t1_cu5v5h7", "children": [], } with self.recorder.use_cassette( "TestMore.test_comments__continue_thread_type", match_requests_on=["uri", "method", "body"], ): more = MoreComments(self.reddit, data) more.submission = self.reddit.submission("3hahrw") assert len(more.comments()) == 1
def test_pickle(self): more = MoreComments(self.reddit, {'children': ['a', 'b'], 'count': 4}) for level in range(pickle.HIGHEST_PROTOCOL + 1): other = pickle.loads(pickle.dumps(more, protocol=level)) assert more == other
def test_pickle(self): more = MoreComments(self.reddit, {"children": ["a", "b"], "count": 4}) for level in range(pickle.HIGHEST_PROTOCOL + 1): other = pickle.loads(pickle.dumps(more, protocol=level)) assert more == other