def testcase_removereadergroup_pop(self): """Test for groups.pop()""" groupssnapshot = list(PCSCReaderGroups()) groups = PCSCReaderGroups() newgroup = 'Pinpad$Readers' groups.insert(0, newgroup) self.assertEquals(groups, [newgroup] + groupssnapshot) groups.pop(0) self.assertEquals(groups, groupssnapshot)
def testcase_addreadertogroup(self): """Test for adding readers to group""" groups = PCSCReaderGroups() newgroup = 'Pinpad$Readers' groups.insert(0, newgroup) for r in PCSCReader.readers('SCard$DefaultReaders'): r.addtoreadergroup(newgroup) self.assertEquals(PCSCReader.readers('SCard$DefaultReaders'), PCSCReader.readers(newgroup)) groups.pop(0) self.assertEquals([], PCSCReader.readers(newgroup))
def testcase_removereaderfromgroup(self): """Test for removing readers from group""" groups = PCSCReaderGroups().instance newgroup = 'Pinpad$Readers' groups.insert(0, newgroup) for r in PCSCReader.readers('SCard$DefaultReaders'): r.addtoreadergroup(newgroup) self.assertEqual(PCSCReader.readers('SCard$DefaultReaders'), PCSCReader.readers(newgroup)) for r in PCSCReader.readers('SCard$DefaultReaders'): r.removefromreadergroup(newgroup) self.assertEqual([], PCSCReader.readers(newgroup)) groups.pop(0) self.assertEqual([], PCSCReader.readers(newgroup))
def testcase_removereaderfromgroup(self): """Test for removing readers from group""" groups = PCSCReaderGroups().instance newgroup = 'Pinpad$Readers' groups.insert(0, newgroup) for r in PCSCReader.readers('SCard$DefaultReaders'): r.addtoreadergroup(newgroup) self.assertEquals( PCSCReader.readers( 'SCard$DefaultReaders'), PCSCReader.readers(newgroup)) for r in PCSCReader.readers('SCard$DefaultReaders'): r.removefromreadergroup(newgroup) self.assertEquals([], PCSCReader.readers(newgroup)) groups.pop(0) self.assertEquals([], PCSCReader.readers(newgroup))