def _test_kwargs(self, prefix): profile = FeatureProfile.from_int(self.features) kwargs = profile.to_kwargs(prefix=prefix) ok_(all([k.startswith(prefix) for k in kwargs.keys()])) eq_(kwargs.values().count(False), bin(self.features)[2:].count('0')) eq_(len(kwargs.values()), len(APP_FEATURES) - len(self.truths))
def _test_kwargs(self, prefix): profile = FeatureProfile.from_int(self.features) kwargs = profile.to_kwargs(prefix=prefix) ok_(all([k.startswith(prefix) for k in kwargs.keys()])) eq_(kwargs.values().count(False), bin(self.features)[2:].count('0')) eq_(len(kwargs.values()), len(APP_FEATURES) - len(self.truths))
def test_from_int_limit(self): profile = FeatureProfile.from_int( self.features, limit=MOCK_APP_FEATURES_LIMIT) self._test_profile_values(profile)
def test_from_int(self): profile = FeatureProfile.from_int(self.features) self._test_profile(profile)
def test_from_int(self): profile = FeatureProfile.from_int(self.features) self._test_profile(profile)
def test_to_base64(self): profile = FeatureProfile.from_int(self.features) signature = profile.to_base64_signature() eq_(signature, self.base64_signature)
def test_from_int_limit(self): profile = FeatureProfile.from_int(self.features, limit=MOCK_APP_FEATURES_LIMIT) self._test_profile_values(profile)
def test_to_base64(self): profile = FeatureProfile.from_int(self.features) signature = profile.to_base64_signature() eq_(signature, self.base64_signature)