async def setup(self, parsed_args, inputs, outputs): npaths = parsed_args.npaths offsets = json.loads(parsed_args.offsets) tasks = [] for x in range(npaths): a = adder.Adder() args = argparse.Namespace(offset=offsets[x]) t = a.run(args, {"input": inputs["path%d" % (x + 1)]}, {"output": outputs["path%d" % (x + 1)]}) tasks.append(t) return tasks
def __init__(self): self.conn = sqlite3.connect('src/weather.db') self.cur = self.conn.cursor() now = datetime.datetime.now() date_time = str(now).split(' ') self.current_date = date_time[0] self.current_time = date_time[1] self.first_day = self.get_first_day() self.get_commands = ['get', 'show'] self.add_commands = ['add'] self.least_get_command_words = 3 self.adder = adder.Adder(self.current_date, self.current_time) self.forecast_days_limit = 5 self.forecaster = forecaster.Forecaster(self.current_date, self.first_day, self.forecast_days_limit) self.forecast_list = []
###SETTINGS DB = "CAT3" problemTime = 1 blankTime = 2 ###COLLECT SUBJECT INFO myArgs = sys.argv try: sid = str(myArgs[1]) #create subject subject = subject.Subject(sid, 1, 1, "StratVerPost") except: subject = adder.Adder("CAT2", "verification_post", 20) sid = 666 ###SET SCREEN screen = get_default_screen() screen.parameters.bgcolor = (0, 0, 0) pygame.font.init() #strat control, mouse clicks def mouse_handler(event): global strat global misfire buttons = pygame.mouse.get_pressed() b1 = buttons[0]
import adder a = adder.Adder(4.5, 3.2) #a.setA(4.5) #a.setB(3.2) print(a.add()) print(a.getter())
def setUp(self): self._adder = adder.Adder()
def test_adder_first(self): s = adder.Adder(10, 1) self.assertEqual(s.sum(), 11)
def test_adder_lots(self): for i in range(100): a, b = random.uniform(0, 1000), random.uniform(0, 1000) s = adder.Adder(a, b) self.assertEqual(s.sum(), a + b) sleep(0.05)