From c5ae77532ff1e00c598722e75532a4afb48a2615 Mon Sep 17 00:00:00 2001 From: Paul Cothenet Date: Wed, 6 Jul 2022 10:47:25 -0700 Subject: [PATCH] Fix test for new demo data (#62) --- .pre-commit-config.yaml | 2 +- requirements.txt | 2 +- test/test_projects_api.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 40339fd..7d41641 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,6 +12,6 @@ repos: - id: flake8 args: ['--config=.flake8'] - repo: https://github.com/psf/black - rev: 21.10b0 + rev: 22.6.0 hooks: - id: black diff --git a/requirements.txt b/requirements.txt index 186bea6..8164e7f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ six >= 1.10 python_dateutil >= 2.5.3 setuptools >= 21.0.0 urllib3 >= 1.15.1 -pre-commit >= 2.10.0 +pre-commit >= 2.19.0 diff --git a/test/test_projects_api.py b/test/test_projects_api.py index 3ac0b51..3ef825e 100644 --- a/test/test_projects_api.py +++ b/test/test_projects_api.py @@ -71,7 +71,7 @@ def test_retrieve_project_language(self): """ project_id = "pro_test_2b67b11a030b66e0a6dd61a56b49079a" project = self.api.retrieve_project(id=project_id, accept_language="fr").data - self.assertIn("Projet", project.name) # French + self.assertIn("Démo", project.name) # French def test_retrieve_projects(self): """Test case for retrieve_projects @@ -87,13 +87,13 @@ def test_retrieve_projects(self): self.assertEqual(project.production, False) self.assertGreater(project.average_price_per_tonne_cents_usd, 0) self.assertGreater(project.remaining_mass_g, 0) - self.assertEqual(project.standard, None) + self.assertIsInstance(project.standard, object) self.assertIsInstance(project.name, str) self.assertTrue(project.description) self.assertIsInstance(project.country, str) self.assertIsInstance(project.type, str) self.assertIsInstance(project.developer, str) - self.assertTrue(isinstance(project.photos, list)) + self.assertIsInstance(project.photos, list) def test_retrieve_biomass_projects(self): """Test case for retrieve_projects with a type filter @@ -141,7 +141,7 @@ def test_retrieve_projects_language(self): projects = self.api.retrieve_projects(accept_language="fr").data for project in projects: - self.assertIn("Projet", project.name) # French + self.assertIn("Démo", project.name) # French if __name__ == "__main__":