def test_normalize_unicode_error(self): s = 'Was\x9f' val = osxcollector._normalize_val(s) T.assert_falsey(isinstance(val, unicode))
def test_assert_falsey_with_msg(self): with assertions.assert_raises_exactly(AssertionError, 'my_msg'): assert_falsey(1, message='my_msg')
def assert_cache_not_written(mock_write): T.assert_falsey(mock_write.called) return None
def test_assert_falsey_two_args_raises(self): with assertions.assert_raises(TypeError): assert_falsey('foo', 'bar')
def test_assert_falsey_garbage_kwarg_raises(self): with assertions.assert_raises(TypeError): assert_falsey('foo', bar='baz')
def test_assert_falsey(self): assert_falsey(None) assert_falsey(0) assert_falsey(0.0) assert_falsey('') assert_falsey(()) assert_falsey([]) assert_falsey({})