Пример #1
0
 def testReadSymbols5(self):
     max_stocks = 5
     with open(self.test_symbol_file, "r") as f_test:
         expected = [line.strip() for line in f_test]
     expected = expected[:max_stocks]
     result = target.read_symbols(self.test_symbol_file, max_stocks)
     self.assertEqual(expected, result, "Target returned: {}".format(result))
Пример #2
0
 def testReadSymbols5(self):
     max_stocks = 5
     with open(self.test_symbol_file, 'r') as f_test:
         expected = [ line.strip() for line in f_test ]
     expected = expected[:max_stocks]
     result = target.read_symbols(self.test_symbol_file, max_stocks)
     self.assertEqual(expected, result, 'Target returned: {}'.format(result))
Пример #3
0
 def testDataSets3(self):
     symbols = target.read_symbols(self.test_symbol_file)
     r_fn = None
     try:
         with tempfile.NamedTemporaryFile(delete=False) as r_file:
             r_fn = r_file.name
             target.make_symbol_sets(symbols, 3, r_file)
         self.assertTrue(filecmp.cmp(self.expected_datasets_all3, r_fn))
     finally:
         os.remove(r_fn)
         r_fn = None
Пример #4
0
 def testDataSets3(self):
     symbols = target.read_symbols(self.test_symbol_file)
     r_fn = None
     try:
         with tempfile.NamedTemporaryFile(delete=False) as r_file:
             r_fn = r_file.name
             target.make_symbol_sets(symbols, 3, r_file)
         self.assertTrue(filecmp.cmp(self.expected_datasets_all3, r_fn))
     finally:
         os.remove(r_fn)
         r_fn = None