class TestPackageManagers(unittest.TestCase):
    def setUp(self):
        if os.environ.get('TRAVIS') == None:
            self.pm = PackageManagers()
            self.db = DBConnector()
            self.config = Config()

    def test_update_package_manager_data(self):
        if os.environ.get('TRAVIS') == None:
            res = self.pm.update_package_manager_data(
                self.config.package_manager_urls)
            self.assertTrue(isinstance(res, PackageManagerData))
            res = self.db.delete_data(res.id, 'package_manager_data')
            self.assertTrue(res)
class TestPackageManagers(unittest.TestCase):
    def setUp(self):
        if os.environ.get('TRAVIS') == None:
            self.pm = PackageManagers()
            self.db = DBConnector()
            self.config = Config()

    def test_update_package_manager_data(self):
        if os.environ.get('TRAVIS') == None:
            res = self.pm.update_package_manager_data(
                self.config.package_manager_urls)
            self.assertTrue(isinstance(res, PackageManagerData))
            res = self.db.delete_data(res.id, 'package_manager_data')
            self.assertTrue(res)
from db_connector import DBConnector
from config import Config
from github import GitHub
from package_managers import PackageManagers
from sendgrid_email import SendGrid

config = Config()
db = DBConnector()
github = GitHub()
pm = PackageManagers()
sg = SendGrid()

# Update the DB with the GitHub repo data
for repo in config.github_repos:
    github.update_library_data(config.github_user, repo)

# Update the DB with Package Manager data
pm.update_package_manager_data(config.package_manager_urls)

# Send an email update
sg.send_email(config.to_email,
              config.from_email,
              config.email_subject,
              config.email_body)