예제 #1
0
def generate_catalogue_from_sf():
    
    catalogue = get_catalogue()
    
    with codecs.open(TEMPLATE_PATH, 'r', 'utf-8') as f:
        template_content = f.read()
        
    template = Template(template_content)
    
    with open (CATALOGUE_PATH, "wb") as f:
        f.write(template.render(catalogue))
    
    return CATALOGUE_PATH
 def test_download_catalogue_from_sf(self):
     catalogue_data = get_catalogue()
     
     self.assertTrue(len(catalogue_data['products']) >= 0, "Problem connecting to SalesForce")
예제 #3
0
    def test_download_catalogue_from_sf(self):
        catalogue_data = get_catalogue()

        self.assertTrue(
            len(catalogue_data['products']) >= 0,
            "Problem connecting to SalesForce")