Example #1
0
    def generateBadge(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(config)
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, csvCertFile, False)

        URL = "https://certifyme.online/"

        self.mdGen.genMDBulkIssueBadge(
            pathToSave + "/" + "_" + self.event.getEventCode(),
            self.event.getEventCode(), URL, self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)
Example #2
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', '*****@*****.**'))
Example #3
0
class test_CertificateDataLoder(unittest.TestCase):
    def setUp(self):
        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()

    def test_CertificateLoading(self):

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name, email" + "\n")
        self.f.write("1 ,ranjith, tharayil ,[email protected]" + "\n")
        self.f.write("2 ,anju, M dominic ,[email protected]" + "\n")
        self.f.close()
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, 'names.csv', True)
        self.assertEqual(2, len(certificates))

    def test_CertificateLoadingNoEmail(self):

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name" + "\n")
        self.f.write("1 ,ranjith, tharayil " + "\n")
        self.f.write("2 ,anju, M dominic " + "\n")
        self.f.write("2 ,anju, M dominic " + "\n")
        self.f.close()
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, 'names.csv', False)
        self.assertEqual(3, len(certificates))

    def test_CertificateLoadingDataCheckWithEmail(self):

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name, email" + "\n")
        self.f.write("1 ,Ranjith, Tharayil ,[email protected]" + "\n")
        self.f.close()
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, 'names.csv', True)
        for c in certificates:
            self.assertEqual('Ranjith Tharayil', c.Name())
            self.assertEqual('*****@*****.**', c.Email())

    def test_CertificateLoadingDataCheckWithNoEmail(self):

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name" + "\n")
        self.f.write("1 ,Ranjith, Tharayil " + "\n")
        self.f.close()
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, 'names.csv', False)
        for c in certificates:
            self.assertEqual('Ranjith Tharayil', c.Name())
    def setUp(self):

        self.mdGen = mdGen()
        self.webPageDataGen = webPageDataGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.f = open('config.yaml', "w")
        self.f.write("Program : XP2020" + "\n")
        self.f.write("IssuedBy : Anju M Dominic" + "\n")
        self.f.write("Institution : Quadralogics" + "\n")
        self.f.write("Date : 29 dec 1982" + "\n")
        self.f.write("Text : A write-up about the event" + "\n")
        self.f.write("Template : ./test/data/AgileNCR_Participation.png" +
                     "\n")
        self.f.write("Logo : ./logo.png" + "\n")
        self.f.write(
            "Message : As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey"
            + "\n")
        self.f.write("Banner : ./banner.png" + "\n")
        self.f.write("CTAMessage : Download our E-Book to learn more" + "\n")
        self.f.write("CTALink : www.q.com" + "\n")
        self.f.write("CTALabel : Dload" + "\n")
        self.f.write("Phone : 898654423" + "\n")
        self.f.write("Email : [email protected]" + "\n")
        self.f.write("WebLink : www.qt.com" + "\n")
        self.f.write("Font : ./res/Font Pack/Ubuntu-B.ttf" + "\n")
        self.f.write("FontSize : 50" + "\n")
        self.f.write("NameX : 150" + "\n")
        self.f.write("NameY : 160" + "\n")
        self.f.write("QRCodeX : 1500" + "\n")
        self.f.write("QRCodeY : 1600" + "\n")
        self.f.write("QRCodeFrontColor : white" + "\n")
        self.f.write("QRCodeBackColor : black" + "\n")
        self.f.write("QRCodeSize : 10" + "\n")
        self.f.write("EventCode: AgileNCR" + "\n")
        self.f.close()
        self.configurationLoader.loadConfig("config.yaml")

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name" + "\n")
        self.f.write("1 ,ranjith, tharayil " + "\n")
        self.f.write("2 ,anju, M dominic " + "\n")
        self.f.write("3 ,Suraj, Meaheta " + "\n")
        self.f.close()
Example #5
0
    def setUp(self):
        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.f = open('config.yaml', "w")
        self.f.write("Program : XP2020" + "\n")
        self.f.write("IssuedBy : Anju M Dominic" + "\n")
        self.f.write("Institution : Quadralogics" + "\n")
        self.f.write("Date : 29 dec 1982" + "\n")
        self.f.write("Text : A write-up about the event" + "\n")
        self.f.write("Template : ./AnuMDominicnew.png" + "\n")
        self.f.write("Logo : ./logo.png" + "\n")
        self.f.write(
            "Message : As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey"
            + "\n")
        self.f.write("Banner : ./banner.png" + "\n")
        self.f.write("CTAMessage : Download our E-Book to learn more" + "\n")
        self.f.write("CTALink : www.q.com" + "\n")
        self.f.write("CTALabel : Dload" + "\n")
        self.f.write("Phone : 898654423" + "\n")
        self.f.write("Email : [email protected]" + "\n")
        self.f.write("WebLink : www.qt.com" + "\n")
        self.f.write("Font : ./res/AngelicaCaroline.ttf" + "\n")
        self.f.write("FontSize : 100" + "\n")
        self.f.write("NameX : 150" + "\n")
        self.f.write("NameY : 160" + "\n")
        self.f.write("QRCodeX : 1500" + "\n")
        self.f.write("QRCodeY : 1600" + "\n")
        self.f.write("QRCodeFrontColor : white" + "\n")
        self.f.write("QRCodeBackColor : black" + "\n")
        self.f.write("QRCodeSize : 10" + "\n")
        self.f.write("EventCode : AgilePCR2021" + "\n")

        self.f.close()
        self.configurationLoader.loadConfig("config.yaml")
Example #6
0
    def generate(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(
            "./test/data//SYNAPSE//config1.yaml")
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, './test/data//SYNAPSE//names.csv', False)

        URL = "https://certifyme.online/CSIT/SYNAPSE/SYNAPSEQA2020/"
        certificateFile = self.issue.BulkIssue(
            pathToSave + "/" + self.event.getEventCode(),
            URL,
            self.allCertificates,
            eventCode=self.event.getEventCode())

        URL = URL + self.event.getEventCode() + "/"

        self.mdGen.genMDBulkIssue(
            pathToSave + "/" + "_" + self.event.getEventCode(), URL,
            self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)
class test_IssueCertificate(unittest.TestCase):
    def setUp(self):
        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.issue = AuthorCertificate()

    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))

    def test_BulkIssue(self):

        pathToSave = './temp'

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name" + "\n")
        self.f.write("1 ,Ranjith, Tharayil " + "\n")
        self.f.write("2 ,Anju, M Dominic " + "\n")
        self.f.write("3 ,Suraj, Meaheta " + "\n")
        self.f.close()
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, 'names.csv', False)
        self.issue.setQRCodeLocation(400, 700)
        self.issue.setNameLocation(739, 274)
        self.issue.setQrCodeSize(3)
        self.issue.setNameFont('./res/Font Pack/Ubuntu-B.ttf', 50)
        self.allCertificates.setTemplate(
            './test/data/AgileNCR_Participation.png')
        certificateFile = self.issue.BulkIssue(
            pathToSave, 'https://certifyme.online/devopsma/',
            self.allCertificates)
        path, dirs, files = next(os.walk(pathToSave))
        file_count = len(files)
        self.assertEqual(file_count, len(certificates))

    def test_QRCodeLocation(self):
        self.issue.setQRCodeLocation(1000, 300)
        x, y = self.issue.getQRCodeLocation()
        self.assertEqual(1000, x)
        self.assertEqual(300, y)

    def test_NameLocation(self):
        self.issue.setNameLocation(1001, 301)
        x, y = self.issue.getNameLocation()
        self.assertEqual(1001, x)
        self.assertEqual(301, y)

    def test_setQrCodeSize(self):
        self.issue.setQrCodeSize(5)
        self.assertEqual(5, self.issue.getQRCodeSize())

    def test_setQRCodeColor(self):
        self.issue.setQRCodeColor('black', 'white')
        back_color, front_color = self.issue.getQRCodeColor()
        self.assertEqual('black', back_color)
        self.assertEqual('white', front_color)

    def test_setNameFont(self):
        self.issue.setNameFont('black', 10)
        font, size = self.issue.getNameFont()
        self.assertEqual('black', font)
        self.assertEqual(10, size)
 def setUp(self):
     self.allCertificates = AllCertificates()
     self.certificateDataLoder = CertificateDataLoder()
     self.issue = AuthorCertificate()
Example #9
0
class test_mdGen(unittest.TestCase):
    def setUp(self):

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.f = open('config.yaml', "w")
        self.f.write("Program : XP2020" + "\n")
        self.f.write("IssuedBy : Anju M Dominic" + "\n")
        self.f.write("Institution : Quadralogics" + "\n")
        self.f.write("Date : 29 dec 1982" + "\n")
        self.f.write("Text : A write-up about the event" + "\n")
        self.f.write("Template : ./AnuMDominicnew.png" + "\n")
        self.f.write("Logo : ./logo.png" + "\n")
        self.f.write(
            "Message : As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey"
            + "\n")
        self.f.write("Banner : ./banner.png" + "\n")
        self.f.write("CTAMessage : Download our E-Book to learn more" + "\n")
        self.f.write("CTALink : www.q.com" + "\n")
        self.f.write("CTALabel : Dload" + "\n")
        self.f.write("Phone : 898654423" + "\n")
        self.f.write("Email : [email protected]" + "\n")
        self.f.write("WebLink : www.qt.com" + "\n")
        self.f.write("Font : ./res/AngelicaCaroline.ttf" + "\n")
        self.f.write("FontSize : 100" + "\n")
        self.f.write("NameX : 150" + "\n")
        self.f.write("NameY : 160" + "\n")
        self.f.write("QRCodeX : 1500" + "\n")
        self.f.write("QRCodeY : 1600" + "\n")
        self.f.write("QRCodeFrontColor : white" + "\n")
        self.f.write("QRCodeBackColor : black" + "\n")
        self.f.write("QRCodeSize : 10" + "\n")
        self.f.write("EventCode: AgileNCR" + "\n")
        self.f.close()
        self.configurationLoader.loadConfig("config.yaml")

    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))

    def test_genMDBulkIssue(self):
        pathToSave = './md'

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name" + "\n")
        self.f.write("1 ,ranjith, tharayil " + "\n")
        self.f.write("2 ,anju, M dominic " + "\n")
        self.f.write("3 ,Suraj, Meaheta " + "\n")
        self.f.close()
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, 'names.csv', False)

        certificateFile = self.mdGen.genMDBulkIssue(
            pathToSave, 'https://certifyme.online/devopsma/',
            self.allCertificates)
        path, dirs, files = next(os.walk(pathToSave))
        file_count = len(files)
        self.assertEqual(file_count, len(certificates))

    def test_genDefaults(self):
        pathToSave = './md'

        self.f = open('names.csv', "w")
        self.f.write("No,First Name ,Second Name" + "\n")
        self.f.write("1 ,ranjith, tharayil " + "\n")
        self.f.write("2 ,anju, M dominic " + "\n")
        self.f.write("3 ,Suraj, Meaheta " + "\n")
        self.f.close()
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, 'names.csv', False)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.assertTrue(os.path.exists(defaultFile))
Example #10
0
class test_ConfigurationLoader(unittest.TestCase):
    def setUp(self):
        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.f = open('config.yaml', "w")
        self.f.write("Program : XP2020" + "\n")
        self.f.write("IssuedBy : Anju M Dominic" + "\n")
        self.f.write("Institution : Quadralogics" + "\n")
        self.f.write("Date : 29 dec 1982" + "\n")
        self.f.write("Text : A write-up about the event" + "\n")
        self.f.write("Template : ./AnuMDominicnew.png" + "\n")
        self.f.write("Logo : ./logo.png" + "\n")
        self.f.write(
            "Message : As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey"
            + "\n")
        self.f.write("Banner : ./banner.png" + "\n")
        self.f.write("CTAMessage : Download our E-Book to learn more" + "\n")
        self.f.write("CTALink : www.q.com" + "\n")
        self.f.write("CTALabel : Dload" + "\n")
        self.f.write("Phone : 898654423" + "\n")
        self.f.write("Email : [email protected]" + "\n")
        self.f.write("WebLink : www.qt.com" + "\n")
        self.f.write("Font : ./res/AngelicaCaroline.ttf" + "\n")
        self.f.write("FontSize : 100" + "\n")
        self.f.write("NameX : 150" + "\n")
        self.f.write("NameY : 160" + "\n")
        self.f.write("QRCodeX : 1500" + "\n")
        self.f.write("QRCodeY : 1600" + "\n")
        self.f.write("QRCodeFrontColor : white" + "\n")
        self.f.write("QRCodeBackColor : black" + "\n")
        self.f.write("QRCodeSize : 10" + "\n")
        self.f.write("EventCode : AgilePCR2021" + "\n")

        self.f.close()
        self.configurationLoader.loadConfig("config.yaml")

    def test_loadConfig_EventName(self):

        self.assertEqual('XP2020', self.event.getProgram())

    def test_loadConfig_issuedBy(self):

        self.assertEqual('Anju M Dominic', self.event.getIssuer())

    def test_loadConfig_institution(self):

        self.assertEqual('Quadralogics', self.event.getInstitution())

    def test_loadConfig_date(self):

        self.assertEqual('29 dec 1982', self.event.getDate())

    def test_loadConfig_EventCode(self):

        self.assertEqual('AgilePCR2021', self.event.getEventCode())

    def test_loadConfig_text(self):

        self.assertEqual('A write-up about the event', self.event.getText())

    def test_loadConfig_template(self):

        self.assertEqual('./AnuMDominicnew.png',
                         self.allCertificates.getTemplate())

    def test_loadConfig_logo(self):

        self.assertEqual('./logo.png', self.ad.getLogo())

    def test_loadConfig_Message(self):

        self.assertEqual(
            'As your organizations progresses through its DevXOps journey, what are the best practices that successful teams use that you should follow? Discover what separates successful DevXOps teams from those that fail, and learn the next steps to take on your DevXOps journey',
            self.ad.getMessage())

    def test_loadConfig_Banner(self):

        self.assertEqual('./banner.png', self.ad.getBanner())

    def test_loadConfig_CTAMessage(self):

        self.assertEqual('Download our E-Book to learn more',
                         self.ad.getCTAMessage())

    def test_loadConfig_CTAMessage(self):

        self.assertEqual('Dload', self.ad.getButtonLabel())

    def test_loadConfig_CTALink(self):

        self.assertEqual('www.q.com', self.ad.getCTALink())

    def test_loadConfig_phone(self):

        self.assertEqual(898654423, self.ad.getPhone())

    def test_loadConfig_email(self):

        self.assertEqual('*****@*****.**', self.ad.getEmail())

    def test_loadConfig_Weblink(self):

        self.assertEqual('www.qt.com', self.ad.getWebLink())

    def test_loadConfig_font(self):

        font, size = self.issue.getNameFont()

        self.assertEqual('./res/AngelicaCaroline.ttf', font)
        self.assertEqual(100, size)

    def test_loadConfig_NamePos(self):
        x, y = self.issue.getNameLocation()
        self.assertEqual(150, x)
        self.assertEqual(160, y)

    def test_loadConfig_QRCodePos(self):
        x, y = self.issue.getQRCodeLocation()
        self.assertEqual(1500, x)
        self.assertEqual(1600, y)

    def test_loadConfig_QRCodeColor(self):
        fg, bg = self.issue.getQRCodeColor()
        self.assertEqual('white', fg)
        self.assertEqual('black', bg)

    def test_loadConfig_QRCodeSize(self):

        self.assertEqual(10, self.issue.getQRCodeSize())
Example #11
0
class webPageDataGen:
    """All Certificates """

    # default constructor
    def __init__(self):
        X = 0

    def generate(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(
            "./test/data//SYNAPSE//config1.yaml")
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, './test/data//SYNAPSE//names.csv', False)

        URL = "https://certifyme.online/CSIT/SYNAPSE/SYNAPSEQA2020/"
        certificateFile = self.issue.BulkIssue(
            pathToSave + "/" + self.event.getEventCode(),
            URL,
            self.allCertificates,
            eventCode=self.event.getEventCode())

        URL = URL + self.event.getEventCode() + "/"

        self.mdGen.genMDBulkIssue(
            pathToSave + "/" + "_" + self.event.getEventCode(), URL,
            self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)

    def generateBadge(self, csvCertFile, config):

        pathToSave = './webPageDataGen'

        self.mdGen = mdGen()

        self.allCertificates = AllCertificates()
        self.certificateDataLoder = CertificateDataLoder()
        self.event = AnEvent()
        self.allCertificates = AllCertificates()
        self.issue = AuthorCertificate()
        self.ad = Advertisement()
        self.configurationLoader = ConfigurationLoader(self.event,
                                                       self.allCertificates,
                                                       self.issue, self.ad)

        self.configurationLoader.loadConfig(config)
        certificates = self.allCertificates.getAllCertificates()
        self.certificateDataLoder = self.certificateDataLoder.load(
            certificates, csvCertFile, False)

        URL = "https://certifyme.online/"

        self.mdGen.genMDBulkIssueBadge(
            pathToSave + "/" + "_" + self.event.getEventCode(),
            self.event.getEventCode(), URL, self.allCertificates)

        defaultFile = self.mdGen.genDefaults(pathToSave, self.issue,
                                             self.event, self.ad)
        self.genLinkCSVFile(self.allCertificates)

    def genLinkCSVFile(self, allCertificates):
        self.f = open('./webPageDataGen/namesWithLink.csv', "w")
        self.f.write("No,First Name ,Second Name , email ,Link" + "\n")
        i = 0

        for cert in allCertificates.getAllCertificates():
            i = i + 1
            firstName, secondName = cert.getName()

            line = str(
                i) + "," + firstName + "," + secondName + "," + cert.Email(
                ) + "," + cert.getWebURL() + "\n"

            self.f.write(line)

        self.f.close()
Example #12
0
class Certificates(unittest.TestCase):
    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', '*****@*****.**'))

    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()))

    def test_getACertificatesName(self):

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

        for c in self.allCertificates.getAllCertificates():
            self.assertEqual('Ranjith Tharayil', c.Name())

    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())
Example #13
0
 def setUp(self):
     self.allCertificates = AllCertificates()
     self.certificateDataLoder = CertificateDataLoder()