How to use the pytmx.convert_to_bool function in PyTMX

To help you get started, we’ve selected a few PyTMX examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_false_it_should_return_false(self):
        self.assertFalse(convert_to_bool("false"))
github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_no_it_should_return_false(self):
        self.assertFalse(convert_to_bool("no"))
github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_garbage_it_should_raise_value_error(self):
        with self.assertRaises(ValueError):
            convert_to_bool("garbage")
github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_yes_it_should_return_true(self):
        self.assertTrue(convert_to_bool("yes"))
github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_None_it_should_raise_value_error(self):
        with self.assertRaises(ValueError):
            convert_to_bool(None)
github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_true_it_should_return_true(self):
        self.assertTrue(convert_to_bool("true"))
github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_non_zero_it_should_return_true(self):
        self.assertTrue(convert_to_bool("1337"))
github bitcraft / PyTMX / tests / test_pytmx.py View on Github external
def test_when_passed_zero_it_should_return_false(self):
        self.assertFalse(convert_to_bool("0"))