Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Oct 7, 2023
1 parent 7763668 commit 0196250
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 11 additions & 0 deletions test/test_faker.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
import enum

import pytest
from faker import Factory

from tblfaker import get_locals, get_providers


class DummyEnum(enum.Enum):
FOO = "foo"
BAR = "bar"


def test_smoke_providers():
fake = Factory.create()

for provider in get_providers():
if provider == "enum":
getattr(fake, provider)(DummyEnum)
continue

getattr(fake, provider)()


Expand Down
10 changes: 6 additions & 4 deletions test/test_tblfaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@ def test_normal(self, providers, rows, table_name, expected):

print_test_result(expected=expected_table, actual=out_table)

assert expected_table == out_table
assert out == expected
assert out.table_name == expected.table_name
assert out.headers == expected.headers
assert out.num_rows == expected.num_rows

def test_normal_specify_header_list(self):
faker = TableFaker(seed=1)
Expand All @@ -83,8 +84,9 @@ def test_normal_specify_header_list(self):

print_test_result(expected=expected_table, actual=out_table)

assert expected_table == out_table
assert out == expected
assert out.table_name == expected.table_name
assert out.headers == expected.headers
assert out.num_rows == expected.num_rows

def test_normal_locale(self):
faker = TableFaker(locale="ja_JP", seed=1)
Expand Down

0 comments on commit 0196250

Please sign in to comment.