コード例 #1
0
    def test_update_with_no_arguments(self):
        s = RedisSet()
        s.update()
        assert s == set()

        s = RedisSet('abcd')
        s.update()
        assert s == {'a', 'b', 'c', 'd'}
コード例 #2
0
    def test_update_with_empty_set(self):
        metasyntactic_variables = RedisSet()
        metasyntactic_variables.update(set())
        assert metasyntactic_variables == set()

        metasyntactic_variables = RedisSet({'foo', 'bar', 'baz'})
        metasyntactic_variables.update(set())
        assert metasyntactic_variables == {'foo', 'bar', 'baz'}
コード例 #3
0
ファイル: test_set.py プロジェクト: brainix/pottery
    def test_update_with_empty_set(self):
        metasyntactic_variables = RedisSet()
        metasyntactic_variables.update(set())
        assert metasyntactic_variables == set()

        metasyntactic_variables = RedisSet({'foo', 'bar', 'baz'})
        metasyntactic_variables.update(set())
        assert metasyntactic_variables == {'foo', 'bar', 'baz'}
コード例 #4
0
ファイル: test_set.py プロジェクト: brainix/pottery
    def test_update_with_no_arguments(self):
        s = RedisSet()
        s.update()
        assert s == set()

        s = RedisSet('abcd')
        s.update()
        assert s == {'a', 'b', 'c', 'd'}
コード例 #5
0
 def test_update_with_set_and_range(self):
     silliness = RedisSet()
     silliness.update({'foo', 'bar', 'baz'}, range(5))
     assert silliness == {'foo', 'bar', 'baz', 0, 1, 2, 3, 4}
     silliness.update({'qux'}, range(6))
     assert silliness == {'foo', 'bar', 'baz', 'qux', 0, 1, 2, 3, 4, 5}
コード例 #6
0
 def test_update_with_range(self):
     ramanujans_friends = RedisSet()
     ramanujans_friends.update(range(10))
     assert ramanujans_friends == {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
コード例 #7
0
 def test_update_with_set(self):
     metasyntactic_variables = RedisSet()
     metasyntactic_variables.update({'foo', 'bar', 'baz'})
     assert metasyntactic_variables == {'foo', 'bar', 'baz'}
     metasyntactic_variables.update({'qux'})
     assert metasyntactic_variables == {'foo', 'bar', 'baz', 'qux'}
コード例 #8
0
ファイル: test_set.py プロジェクト: brainix/pottery
 def test_update_with_set_and_range(self):
     silliness = RedisSet()
     silliness.update({'foo', 'bar', 'baz'}, range(5))
     assert silliness == {'foo', 'bar', 'baz', 0, 1, 2, 3, 4}
     silliness.update({'qux'}, range(6))
     assert silliness == {'foo', 'bar', 'baz', 'qux', 0, 1, 2, 3, 4, 5}
コード例 #9
0
ファイル: test_set.py プロジェクト: brainix/pottery
 def test_update_with_range(self):
     ramanujans_friends = RedisSet()
     ramanujans_friends.update(range(10))
     assert ramanujans_friends == {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
コード例 #10
0
ファイル: test_set.py プロジェクト: brainix/pottery
 def test_update_with_set(self):
     metasyntactic_variables = RedisSet()
     metasyntactic_variables.update({'foo', 'bar', 'baz'})
     assert metasyntactic_variables == {'foo', 'bar', 'baz'}
     metasyntactic_variables.update({'qux'})
     assert metasyntactic_variables == {'foo', 'bar', 'baz', 'qux'}