Esempio n. 1
0
    def test_call_cache_set(self, set_mock, has_mock):
        has_mock.return_value = False

        result1 = get_thumb_name('test.jpg')
        assert set_mock.call_count == 1

        result2 = get_thumb_name('test.jpg')
        assert set_mock.call_count == 2

        has_mock.return_value = True

        result3 = get_thumb_name('test.jpg')
        assert set_mock.call_count == 2

        assert result1 == result2 == result3
Esempio n. 2
0
 def test_call_valid(self):
     result1 = get_thumb_name('test.jpg', arg1=1, arg2=2)
     get_thumb_data(result1)
Esempio n. 3
0
    def test_call_option_ordering(self):
        result1 = get_thumb_name('test.jpg', arg1=1, arg2=2)
        result2 = get_thumb_name('test.jpg', arg2=2, arg1=1)

        assert result1 == result2
Esempio n. 4
0
 def test_call(self):
     assert get_thumb_name('test.jpg', arg1=1, arg2=2) == (
         '207736f753aeca1bdbc5ebd4d2e265d45194fc28/test.jpg'
     )