importlib refactor test_l3_longevity.py

This commit is contained in:
erinnerim
2021-09-10 15:23:05 -07:00
parent 3656bd1a59
commit 3b81071aa7

View File

@@ -44,34 +44,35 @@ COPYRIGHT:
Copyright 2021 Candela Technologies Inc Copyright 2021 Candela Technologies Inc
INCLUDE_IN_README INCLUDE_IN_README
''' '''
import sys import sys
import os import os
import importlib
from pprint import pprint
import serial
import pexpect
from pexpect_serial import SerialSpawn
import argparse
import time
import datetime
import csv
if sys.version_info[0] != 3: if sys.version_info[0] != 3:
print("This script requires Python 3") print("This script requires Python 3")
exit(1) exit(1)
if 'py-json' not in sys.path: if 'lanforge-scripts' not in sys.path:
sys.path.append(os.path.join(os.path.abspath('..'), 'py-json')) sys.path.append(os.path.join(os.path.abspath(__file__ + "../../../")))
if 'py-dashboard' not in sys.path:
sys.path.append(os.path.join(os.path.abspath('..'), 'py-dashboard'))
from pprint import pprint
from InfluxRequest import * from InfluxRequest import *
import serial InfluxRequest = importlib.import_module("lanforge-scripts.py-dashboard.InfluxRequest")
import pexpect
from pexpect_serial import SerialSpawn
from lf_report import lf_report
import argparse
from LANforge import LFUtils from LANforge import LFUtils
LFUtils = importlib.import_module("lanforge-scripts.py-json.LANforge.LFUtils")
from realm import Realm from realm import Realm
import time realm = importlib.import_module("lanforge-scripts.py-json.realm")
import datetime Realm = realm.Realm
import csv from lf_report import lf_report
lf_report = importlib.import_module("lanforge-scripts.py-scripts.lf_report")
# This class handles running the test and generating reports. # This class handles running the test and generating reports.
class L3VariableTime(Realm): class L3VariableTime(Realm):