Skip to content

Commit

Permalink
Python2 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
matejak committed May 9, 2023
1 parent 2203b7c commit e9c5b67
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/unit/ssg-module/test_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,18 @@ def test_product_yaml(testing_product_yaml_path):
assert copied_product["pkg_system"] == "rpm"


def test_product_yaml_write(testing_product_yaml_path, tmp_path):
@pytest.fixture
def product_filename_py2(tmpdir):
return tmpdir.join("tmp_product.yml")


@pytest.fixture
def product_filename_py3(tmp_path):
return tmp_path / "tmp_product.yml"


def test_product_yaml_write(testing_product_yaml_path, product_filename_py2):
product = ssg.products.Product(testing_product_yaml_path)
filename = tmp_path / "tmp_product.yml"
product.write(filename)
second_product = ssg.products.Product(filename)
product.write(product_filename_py2)
second_product = ssg.products.Product(product_filename_py2)
assert product["product_dir"] == second_product["product_dir"]

0 comments on commit e9c5b67

Please sign in to comment.