Пример #1
0
	def test_read_data_from_file(self):
		Store.set_file(file_path)
		a = ["Iron Man3", "2013", "8.5"]
		b = Store.read_data_from_file()[0]
		self.assertListEqual(a, b)
Пример #2
0
	def test_create_file(self):
		Store.set_file(file_path)
		self.assertTrue(Store.create_file)
Пример #3
0
	def test_is_the_file_usable(self):
		Store.set_file(file_path)
		self.assertTrue(Store.is_usable())
Пример #4
0
	def test_write_into_the_file(self):
		args = ["Iron Man3", "2013", "8.5"]
		self.assertTrue(Store.write_into_file(args))
Пример #5
0
	def test_class_variable_file(self):
		Store.set_file(file_path)
		self.assertEqual(file_path,Store.file_name) 
Пример #6
0
	def test_read_movies_from_file(self):
		Store.set_file(file_path)
		a = Movie.read_movies_from_file()[0]
		self.assertIsInstance(a, Movie)
Пример #7
0
	def test_add_movie_into_file(self):
		Store.set_file(file_path)
		args = ["Super Man", "2013", "8.5"]
		self.assertTrue(Movie.add_movie_into_file(args))
Пример #8
0
    parser = argparse.ArgumentParser()
    parser.add_argument("-t",
                        "--theme",
                        help="theme name, defaults to 'default'",
                        default="default")
    parser.add_argument(
        "-o",
        "--output",
        help="output directory, defaults to 'docs/html' in the repository",
        default=os.path.join(DOCDIR, "html"),
    )
    parser.add_argument(
        "-f",
        "--overwrite",
        help="allow overwriting output directory when it exists",
        action="store_true")
    parser.add_argument("-b",
                        "--build",
                        help="set build ID information",
                        default=None)

    ns = parser.parse_args()

    if os.path.exists(ns.output) and not ns.overwrite:
        print(
            f"Error: output path {ns.output} exists, pass --overwrite to overwrite"
        )
        sys.exit(1)

    render(Store(), ns.theme, ns.output, ns.build)
Пример #9
0
             "maintenance:" + conf.SERVER.maintenance)

except Exception as inst:
    print("Initializing failed")
    print(type(inst))
    print(inst.args)
    print(inst)
    sys.exit(-1)
"""
    Init Db connection

"""
try:
    stage1.i("DB Connecting", str(conf.SERVER.db_ip), str(conf.SERVER.db_port))

    db = Store()

    def initStatus(f):
        if (not f.exception()):
            stage1.d("DB connected")
        else:
            stage1.e("DB connection error", str(f.exception()))

    db.connect(conf.SERVER.db_ip, conf.SERVER.db_username,
               conf.SERVER.db_password, conf.SERVER.db_port, initStatus)

except Exception as inst:
    stage1.e_tb("DB connection error", inst)
    sys.exit(-1)