Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(14)  |  Derive(0)  |  Import(0)

src/g/o/googlesafebrowsing-0.2.beta.git/googlesafebrowsing/sblist_test.py   googlesafebrowsing(Download)
    self.assertTrue(self._list.AddFullHash('0000full', 4, 42))
 
    entry = sblist.AddEntry('0000', 4, '0000full')
    self.assertSameElements([entry], self._list.GetPrefixMatches('0000'))
 
    # Test adding a prefix to a new chunk.
    self.assertTrue(self._list.AddPrefix('asdf', 10))
    entry = sblist.AddEntry('asdf', 10)
    self.assertSameElements([entry], self._list.GetPrefixMatches('asdfasdf'))
    self.assertSameElements([entry], self._list.GetPrefixMatches('asdf'))
 
    # Test adding a prefix to an existing chunk.
    self.assertTrue(self._list.AddPrefix('asdfasdf', 3))
    other_entry = sblist.AddEntry('asdfasdf', 3)
    # Remove first of two prefixes.
    self.assertTrue(self._list.RemovePrefix('aprefix', 8, 1))
    entry = sblist.AddEntry('aprefix', 3)
    self.assertSameElements([entry], self._list.GetPrefixMatches('aprefix'))
    # Remove second prefix.
    self.assertTrue(self._list.DeleteAddChunk(1))
    self.assertFalse(self._list.GotAddChunk(1))
    entry = sblist.AddEntry('aprefix', 3)
    self.assertSameElements([entry], self._list.GetPrefixMatches('aprefix'))
    self.assertSameElements([], self._list.GetPrefixMatches('cprefix'))

src/g/o/google-safe-browsing-HEAD/googlesafebrowsing/sblist_test.py   google-safe-browsing(Download)
    self.assertTrue(self._list.AddFullHash('0000full', 4, 42))
 
    entry = sblist.AddEntry('0000', 4, '0000full')
    self.assertSameElements([entry], self._list.GetPrefixMatches('0000'))
 
    # Test adding a prefix to a new chunk.
    self.assertTrue(self._list.AddPrefix('asdf', 10))
    entry = sblist.AddEntry('asdf', 10)
    self.assertSameElements([entry], self._list.GetPrefixMatches('asdfasdf'))
    self.assertSameElements([entry], self._list.GetPrefixMatches('asdf'))
 
    # Test adding a prefix to an existing chunk.
    self.assertTrue(self._list.AddPrefix('asdfasdf', 3))
    other_entry = sblist.AddEntry('asdfasdf', 3)
    # Remove first of two prefixes.
    self.assertTrue(self._list.RemovePrefix('aprefix', 8, 1))
    entry = sblist.AddEntry('aprefix', 3)
    self.assertSameElements([entry], self._list.GetPrefixMatches('aprefix'))
    # Remove second prefix.
    self.assertTrue(self._list.DeleteAddChunk(1))
    self.assertFalse(self._list.GotAddChunk(1))
    entry = sblist.AddEntry('aprefix', 3)
    self.assertSameElements([entry], self._list.GetPrefixMatches('aprefix'))
    self.assertSameElements([], self._list.GetPrefixMatches('cprefix'))