Created
April 23, 2021 00:47
-
-
Save press0/f8f874c7c17e0991e1c8a829d548855b to your computer and use it in GitHub Desktop.
@mock.patch.dict
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SettingsTests(TestCase): | |
@mock.patch.dict(os.environ, {"FROBNICATION_COLOUR": "ROUGE"}) | |
def test_frobnication_colour(self): | |
colour = os.environ["FROBNICATION_COLOUR"] | |
self.assertEqual(colour, "ROUGE") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment