Exemplo n.º 1
0
    def test_url_callable(self, tmpdir, key):
        prefix = 'http://some.prefix.invalid/'
        mock_callable = Mock(return_value=prefix)

        store = WebFilesystemStore(tmpdir, mock_callable)

        expected = prefix + url_quote(key)
        assert store.url_for(key) == expected

        mock_callable.assert_called_with(store, key)
Exemplo n.º 2
0
    def test_url_callable(self, tmpdir, key):
        prefix = 'http://some.prefix.invalid/'
        mock_callable = Mock(return_value=prefix)

        store = WebFilesystemStore(tmpdir, mock_callable)

        expected = prefix + url_quote(key)
        assert store.url_for(key) == expected

        mock_callable.assert_called_with(store, key)
Exemplo n.º 3
0
 def test_correct_file_uri(self, store, tmpdir, key):
     expected = 'file://' + tmpdir + '/' + url_quote(key)
     assert store.url_for(key) == expected
Exemplo n.º 4
0
 def test_url(self, store, url_prefix, key):
     expected = url_prefix + url_quote(key)
     assert store.url_for(key) == expected
Exemplo n.º 5
0
 def test_correct_file_uri(self, store, tmpdir, key):
     expected = 'file://' + tmpdir + '/' + url_quote(key)
     assert store.url_for(key) == expected
Exemplo n.º 6
0
 def test_url(self, store, url_prefix, key):
     expected = url_prefix + url_quote(key)
     assert store.url_for(key) == expected