|
1 | 1 | from .helper import UnitHelper, mock |
2 | | -from github3.structs import GitHubIterator, NullObject |
3 | | - |
4 | | -import pytest |
| 2 | +from github3.structs import GitHubIterator |
5 | 3 |
|
6 | 4 |
|
7 | 5 | class TestGitHubIterator(UnitHelper): |
@@ -38,61 +36,3 @@ def test_stores_headers_properly(self): |
38 | 36 | i = GitHubIterator(count, url, cls, session, headers=headers) |
39 | 37 | assert i.headers != {} |
40 | 38 | assert i.headers.get('Accept') == 'foo' |
41 | | - |
42 | | - |
43 | | -class TestNullObject(UnitHelper): |
44 | | - described_class = NullObject |
45 | | - |
46 | | - def create_instance_of_described_class(self): |
47 | | - return self.described_class() |
48 | | - |
49 | | - def test_returns_empty_list(self): |
50 | | - assert list(self.instance) == [] |
51 | | - |
52 | | - def test_contains_nothing(self): |
53 | | - assert 'foo' not in self.instance |
54 | | - |
55 | | - def test_returns_itself_when_called(self): |
56 | | - assert self.instance('foo', 'bar', 'bogus') is self.instance |
57 | | - |
58 | | - def test_returns_empty_string(self): |
59 | | - assert str(self.instance) == '' |
60 | | - |
61 | | - def test_allows_arbitrary_attributes(self): |
62 | | - assert self.instance.attr is self.instance |
63 | | - |
64 | | - def test_allows_arbitrary_attributes_to_be_set(self): |
65 | | - self.instance.attr = 'new' |
66 | | - assert self.instance.attr is self.instance |
67 | | - |
68 | | - def test_provides_an_api_to_check_if_it_is_null(self): |
69 | | - assert self.instance.is_null() |
70 | | - |
71 | | - def test_stops_iteration(self): |
72 | | - with pytest.raises(StopIteration): |
73 | | - next(self.instance) |
74 | | - |
75 | | - def test_next_raises_stops_iteration(self): |
76 | | - with pytest.raises(StopIteration): |
77 | | - self.instance.next() |
78 | | - |
79 | | - def test_getitem_returns_itself(self): |
80 | | - assert self.instance['attr'] is self.instance |
81 | | - |
82 | | - def test_setitem_sets_nothing(self): |
83 | | - self.instance['attr'] = 'attr' |
84 | | - assert self.instance['attr'] is self.instance |
85 | | - |
86 | | - def test_turns_into_unicode(self): |
87 | | - unicode_str = b''.decode('utf-8') |
88 | | - try: |
89 | | - assert unicode(self.instance) == unicode_str |
90 | | - except NameError: |
91 | | - assert str(self.instance) == unicode_str |
92 | | - |
93 | | - def test_instances_are_falsey(self): |
94 | | - if self.instance: |
95 | | - pytest.fail() |
96 | | - |
97 | | - def test_instances_can_be_coerced_to_zero(self): |
98 | | - assert int(self.instance) == 0 |
0 commit comments