コード例 #1
0
 def setUp(self):
     self.allCertificates = AllCertificates()
     self.allCertificates.getAllCertificates().append(
         Certificate('Ranjith', 'Tharayil', '*****@*****.**'))
     self.allCertificates.getAllCertificates().append(
         Certificate('R', 'Tharayil', '*****@*****.**'))
     self.allCertificates.getAllCertificates().append(
         Certificate('anjith', 'Tharayil', '*****@*****.**'))
コード例 #2
0
    def test_AddingCertificates(self):

        self.allCertificates.getAllCertificates().clear()
        self.allCertificates.getAllCertificates().append(
            Certificate('Ranjith', 'Tharayil', '*****@*****.**'))
        self.allCertificates.getAllCertificates().append(
            Certificate('Ranjith', 'Tharayil', '*****@*****.**'))
        self.allCertificates.getAllCertificates().append(
            Certificate('Ranjith', 'Tharayil', '*****@*****.**'))
        self.assertEqual(3, len(self.allCertificates.getAllCertificates()))
コード例 #3
0
    def load(self, certificates, inputFileName, email):

        with open(inputFileName, 'r') as file:
            reader = csv.reader(file, delimiter=',')
            for row in reader:
                if email == True:
                    certificates.append(
                        Certificate(row[1].strip(), row[2].strip(),
                                    row[3].strip()))
                else:
                    certificates.append(
                        Certificate(row[1].strip(), row[2].strip(), 'NoEmail'))

        certificates.pop(0)
コード例 #4
0
    def test_getACertificatesEmail(self):

        self.allCertificates.getAllCertificates().clear()
        self.allCertificates.getAllCertificates().append(
            Certificate('Ranjith', ' Tharayil', '*****@*****.**'))

        for c in self.allCertificates.getAllCertificates():
            self.assertEqual('*****@*****.**', c.Email())
コード例 #5
0
    def test_genMDFile(self):
        pathToSave = './md'

        if os.path.isdir(pathToSave):
            shutil.rmtree(pathToSave)
        os.mkdir(pathToSave)
        certificate = Certificate('Rahul', 'Panday', '*****@*****.**')

        mdFile = self.mdGen.Create(pathToSave,
                                   'https://certifyme.online/devopsma/',
                                   certificate)

        self.assertTrue(os.path.exists(mdFile))
コード例 #6
0
    def test_Create(self):

        pathToSave = './temp'
        if os.path.isdir(pathToSave):
            shutil.rmtree(pathToSave)

        os.mkdir(pathToSave)
        certificate = Certificate('Rahul', 'Panday', '*****@*****.**')

        certificateFile = self.issue.Create(
            './test/data/template.png', pathToSave,
            'https://certifyme.online/devopsma/', certificate)

        self.assertTrue(os.path.exists(pathToSave + '/' + certificateFile))