Skip to content

Commit

Permalink
Add explicit unittests for get_field_enum inference on boolean fields
Browse files Browse the repository at this point in the history
refs #1540
  • Loading branch information
davidmiller committed Oct 26, 2018
1 parent 9f51433 commit 0ce132e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions opal/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ def test_enum(self):
enum = FavouriteColour.get_field_enum('name')
self.assertEqual(enum, ["purple", "yellow", "blue"])

def test_get_field_enum_for_boolean_field(self):
enum = HatWearer.get_field_enum('wearing_a_hat')
self.assertEqual(enum, ['Yes', 'No'])

def test_get_field_enum_for_null_boolean_field(self):
enum = HatWearer.get_field_enum('suits_a_hat')
self.assertEqual(enum, ['Yes', 'No', 'Unknown'])

def test_description(self):
description = FavouriteColour.get_field_description('name')
self.assertEqual(description, "orange is the new black")
Expand Down

0 comments on commit 0ce132e

Please sign in to comment.