Skip to content

Commit

Permalink
Add one more test
Browse files Browse the repository at this point in the history
  • Loading branch information
17451k committed Dec 30, 2020
1 parent 1f99557 commit ed7f36c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# limitations under the License.

import os
import pytest
import shutil
import unittest.mock

Expand Down Expand Up @@ -44,7 +45,8 @@ def test_storage_with_conversion(tmpdir):
c.add_file_to_storage(test_file)


def test_storage_encoding(tmpdir):
@pytest.mark.parametrize("encoding", ["cp1251", "utf8"])
def test_storage_encoding(tmpdir, encoding):
c = Clade(tmpdir, conf={"Storage.convert_to_utf8": True})

bstr = "мир".encode("cp1251")
Expand All @@ -53,4 +55,4 @@ def test_storage_encoding(tmpdir):
with open(test_file, "wb") as fh:
fh.write(bstr)

c.add_file_to_storage(test_file, encoding="utf8")
c.add_file_to_storage(test_file, encoding=encoding)

0 comments on commit ed7f36c

Please sign in to comment.