示例#1
0
    def test_load(self):
        it = callerIdList()
        lines=[
'#THIS IS A COMMENT',
'#--DATE = 061913--TIME = 0848--NMBR = 8885551212--NAME = Scum Sucker    --',
'--DATE = 061913--TIME = 0848--NMBR = 8885551212--NAME = Scum Sucker    --',
'--DATE = 061913--TIME = 0848--NMBR = 4087727741--NAME = Scum Sucker    --',
        ]
        it.load(lines)
        self.assertEquals(2, len(it.dict))
        self.assertEquals(0, len(it.myset))
示例#2
0
 def test_load(self):
     it = callerIdList()
     lines = [
         '#THIS IS A COMMENT',
         '#--DATE = 061913--TIME = 0848--NMBR = 8885551212--NAME = Scum Sucker    --',
         '--DATE = 061913--TIME = 0848--NMBR = 8885551212--NAME = Scum Sucker    --',
         '--DATE = 061913--TIME = 0848--NMBR = 4087727741--NAME = Scum Sucker    --',
     ]
     it.load(lines)
     self.assertEquals(2, len(it.dict))
     self.assertEquals(0, len(it.myset))
示例#3
0
#
# You should have received a copy of the GNU General Public License along with
# this program.  If not, see <http://www.gnu.org/licenses/>.

"""
This is meant to be run via ssh on the computer that runs jcblock, so the
score checking libs should be the ones that don't depend on a real browser
"""
import callercomplaints

from lib.calleridlist import callerIdList
from lib import blacklist
from whocalledus import whocalled

if __name__ == '__main__':
    raise NotImplementedError  # when you put in your password, take this out
    wc = whocalled('YourUserName', 'YourPassword')
    cc = callercomplaints()

    it = callerIdList()
    it.loadFromFile()
    it.pickNewBlacklistEntries([wc, cc])

    bl = blacklist()
    bl.loadFromFile()
    bl.merge(it.getNewBlacklistEntries())
    #print bl
    bl.save()


示例#4
0
 def test_CreateList(self):
     it = callerIdList()
     self.assertEquals(0, len(it.dict))
     self.assertEquals(0, len(it.myset))
示例#5
0
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program.  If not, see <http://www.gnu.org/licenses/>.
"""
This is meant to be run via ssh on the computer that runs jcblock, so the
score checking libs should be the ones that don't depend on a real browser
"""
import callercomplaints

from lib.calleridlist import callerIdList
from lib import blacklist
from whocalledus import whocalled

if __name__ == '__main__':
    raise NotImplementedError  # when you put in your password, take this out
    wc = whocalled('YourUserName', 'YourPassword')
    cc = callercomplaints()

    it = callerIdList()
    it.loadFromFile()
    it.pickNewBlacklistEntries([wc, cc])

    bl = blacklist()
    bl.loadFromFile()
    bl.merge(it.getNewBlacklistEntries())
    #print bl
    bl.save()
示例#6
0
 def test_CreateList(self):
     it = callerIdList()
     self.assertEquals(0, len(it.dict))
     self.assertEquals(0, len(it.myset))