Millenium

Generation

testsMon, 10 Apr 2023

def search(lines, type_lines): for line in lines: if line.line_type == type_lines: return line def fibonacci_level(lines): for i in range(0,10): lines.append(lines.add_fibo_level(i/10)) def check_candle(lines, candles): for i in range(1, len(candles)): if candles[i].low < lines[-1].low and candles[i].high > lines[-1].high: return candles[i] else: return candles[i-1] def main(): lines = context.lines candles = context.candles fibonacci_level(lines) check_candle(lines, candles)

### Testing * When you run `python3 -m unittest`, all python files in the current directory that start with `test_` will be run. * If you wish to run a specific test, you can use `python3 -m unittest test_example.py`. * You can also use `python3 -m unittest test_example.TestAdd` to run a specific test case. * You can run tests from a single file by using the `-f` flag: `python3 -m unittest -f` * You can also use the `-c` flag to exclude certain tests. * You can run tests with a specific argument by using the `-a` flag: `python3 -m unittest -a <argument>` * You can also run tests with a custom argument by using the `-c` flag: `python3 -m unittest -c <custom_argument>` * ### Writing tests * In order to write tests, we need to understand the basic structure of a test.

Questions about programming?Chat with your personal AI assistant