Skip to content

Commit

Permalink
Fix test for new demo data (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcothenet authored Jul 6, 2022
1 parent 8880d42 commit c5ae775
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions test/test_projects_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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__":
Expand Down

0 comments on commit c5ae775

Please sign in to comment.