Esempio n. 1
0
    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))
Esempio n. 2
0
    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))
Esempio n. 3
0
 def test_from_int_limit(self):
     profile = FeatureProfile.from_int(
         self.features, limit=MOCK_APP_FEATURES_LIMIT)
     self._test_profile_values(profile)
Esempio n. 4
0
 def test_from_int(self):
     profile = FeatureProfile.from_int(self.features)
     self._test_profile(profile)
Esempio n. 5
0
 def test_from_int(self):
     profile = FeatureProfile.from_int(self.features)
     self._test_profile(profile)
Esempio n. 6
0
 def test_to_base64(self):
     profile = FeatureProfile.from_int(self.features)
     signature = profile.to_base64_signature()
     eq_(signature, self.base64_signature)
Esempio n. 7
0
 def test_from_int_limit(self):
     profile = FeatureProfile.from_int(self.features,
                                       limit=MOCK_APP_FEATURES_LIMIT)
     self._test_profile_values(profile)
Esempio n. 8
0
 def test_to_base64(self):
     profile = FeatureProfile.from_int(self.features)
     signature = profile.to_base64_signature()
     eq_(signature, self.base64_signature)