def test_mismatch_sets_object(self):
     obj = object()
     mismatch = IsProxied().match(obj)
     self.assertEqual(obj, mismatch.obj)
 def test_match(self):
     obj = ProxyFactory(object(), checker=NamesChecker())
     self.assertEqual(None, IsProxied().match(obj))
 def test_mismatch(self):
     obj = object()
     self.assertIsInstance(IsProxied().match(obj), IsNotProxied)
Beispiel #4
0
 def test_makeBinaryPackageBuild_returns_proxy(self):
     bpb = self.factory.makeBinaryPackageBuild()
     self.assertThat(bpb, IsProxied())
 def test_str(self):
     matcher = IsProxied()
     self.assertEqual("Is proxied.", str(matcher))
Beispiel #6
0
 def test_makeSPPHForBPPH_returns_ISPPH(self):
     bpph = self.factory.makeBinaryPackagePublishingHistory()
     spph = self.factory.makeSPPHForBPPH(bpph)
     self.assertThat(spph, IsProxied())
     self.assertThat(removeSecurityProxy(spph),
                     Provides(ISourcePackagePublishingHistory))
Beispiel #7
0
 def test_makeSourcePackagePublishingHistory_returns_proxied(self):
     spph = self.factory.makeSourcePackagePublishingHistory()
     self.assertThat(spph, IsProxied())
Beispiel #8
0
 def test_makeDistroSeries_returns_proxy(self):
     distroseries = self.factory.makeDistroSeries()
     self.assertThat(distroseries, IsProxied())
Beispiel #9
0
 def test_makeDistribution_returns_proxy(self):
     distribution = self.factory.makeDistribution()
     self.assertThat(distribution, IsProxied())
Beispiel #10
0
 def test_makeBinaryPackagePublishingHistory_returns_proxied(self):
     bpph = self.factory.makeBinaryPackagePublishingHistory()
     self.assertThat(bpph, IsProxied())