Skip to content
Snippets Groups Projects
Commit db311b9b authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Cleanup and add test facility

parent e77406ba
No related branches found
No related tags found
No related merge requests found
Pipeline #1787 failed
#!usr/bin/env python
# -*- coding: utf-8 -*-
# Filename: bar.py
"""
The bar module.
"""
from __future__ import absolute_import, print_function, division
__author__ = "Your Name"
__credits__ = ["The guy in your office", "Tom"]
__license__ = "MIT"
__maintainer__ = "Your Buddy"
__email__ = "yname@km3net.de"
def whats_the_meaning_of_life(n_cores=23):
"""Answers the question about the meaning of life.
You don't even have to ask the question, it will figure it out for you.
Don't use more cores than available to mankind.
Parameters
----------
n_cores: int [default: 23]
The number of CPU cores to use.
Returns
-------
int
The type of the expected answer is of course an integer.
"""
return 42
#!usr/bin/env python
# -*- coding: utf-8 -*-
# Filename: test_bar.py
from unittest import TestCase
from foo.bar import whats_the_meaning_of_life
__author__ = "Your Name"
__credits__ = []
__license__ = "MIT"
__maintainer__ = "Your Name"
__email__ = "yname@km3net.de"
class TestMeaningOfLife(TestCase):
"""Tests for the bar module"""
def test_meaning_of_life(self):
assert 1 == whats_the_meaning_of_life()
def test_meaning_of_life_with_one_core(self):
assert 1 == whats_the_meaning_of_life(n_cores=1)
#!/usr/bin/env python
#!usr/bin/env python
# -*- coding: utf-8 -*-
# Filename: setup.py
"""
Foo setup script.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment