예제 #1
0
 def test_fake_display_nested(self):
     f = fake_display.DisplayFaker()
     profile = {
         "staff_information": {
             "title": {
                 "metadata": {
                     "display": "staff"
                 }
             }
         }
     }
     f.populate(profile,
                policy=fake_display.DisplayFakerPolicy.max_display())
     assert profile["staff_information"]["title"]["metadata"][
         "display"] == "ndaed"
예제 #2
0
 def test_fake_display_empty(self):
     f = fake_display.DisplayFaker()
     profile = {}
     f.populate(profile)
     assert not profile
예제 #3
0
 def test_fake_display_max(self):
     f = fake_display.DisplayFaker()
     profile = {"user_id": {"metadata": {"display": "private"}}}
     f.populate(profile,
                policy=fake_display.DisplayFakerPolicy.max_display())
     assert profile["user_id"]["metadata"]["display"] == "public"
예제 #4
0
 def test_fake_display_is_null(self):
     f = fake_display.DisplayFaker()
     profile = {"user_id": {"metadata": {"display": None}}}
     f.populate(profile,
                policy=fake_display.DisplayFakerPolicy.min_display())
     assert profile["user_id"]["metadata"]["display"] is None