Ejemplo n.º 1
0
class TestMountain(unittest.TestCase):
    def setUp(self):
        self.mountain = Mountain()

    def test_it_gets_test_results(self):
        with patch_object(self.mountain.stream, 'writeln', Mock()):
            with patch_object(self.mountain.lesson, 'learn', Mock()):
                self.mountain.walk_the_path()
                self.assertTrue(self.mountain.lesson.learn.called)
Ejemplo n.º 2
0
class TestMountain(unittest.TestCase):

    def setUp(self):
        self.mountain = Mountain()

    def test_it_gets_test_results(self):
        with patch_object(self.mountain.stream, 'writeln', Mock()):
            with patch_object(self.mountain.lesson, 'learn', Mock()):
                self.mountain.walk_the_path()
                self.assertTrue(self.mountain.lesson.learn.called)
Ejemplo n.º 3
0
class TestMountain(unittest.TestCase):
    def setUp(self):
        path_to_enlightenment.koans = Mock()
        self.mountain = Mountain()
        self.mountain.stream.writeln = Mock()

    def test_it_gets_test_results(self):
        self.mountain.lesson.learn = Mock()
        self.mountain.walk_the_path()
        self.assertTrue(self.mountain.lesson.learn.called)
Ejemplo n.º 4
0
class TestMountain(unittest.TestCase):

    def setUp(self):
        path_to_enlightenment.koans = Mock()
        self.mountain = Mountain()
        self.mountain.stream.writeln = Mock()
        
    def test_it_gets_test_results(self):
        self.mountain.lesson.learn = Mock()
        self.mountain.walk_the_path()
        self.assertTrue(self.mountain.lesson.learn.called)
Ejemplo n.º 5
0
 def setUp(self):
     path_to_enlightenment.koans = Mock()
     self.mountain = Mountain()
     self.mountain.stream.writeln = Mock()
Ejemplo n.º 6
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# Acknowledgment:
#
# Python Koans is a port of Ruby Koans originally written by Jim Weirich
# and Joe O'brien of Edgecase. There are some differences and tweaks specific
# to the Python language, but a great deal of it has been copied wholesale.
# So thank guys!
#

import unittest
import sys

if __name__ == '__main__':
    if sys.version_info < (3, 0):
        print("\nThis is the Python 3 version of Python Koans, but you are " +
            "running it with Python 2 or older!\n\n"
            "Did you accidentally use the wrong python script? \nTry:\n\n" +
            "    python3 contemplate_koans.py\n")
    else:
        from runner.mountain import Mountain

        Mountain().walk_the_path(sys.argv)
Ejemplo n.º 7
0
 def setUp(self):
     self.mountain = Mountain()
Ejemplo n.º 8
0
 def on_modified(self, event):
     #print event.event_type, event.src_path
     if (is_about_file(event.src_path)):
         from runner.mountain import Mountain
         Mountain().walk_the_path(".")
Ejemplo n.º 9
0
 def setUp(self):
     self.mountain = Mountain()
#
# Python Koans is a port of Ruby Koans originally written by Jim Weirich
# and Joe O'brien of Edgecase. There are some differences and tweaks specific
# to the Python language, but a great deal of it has been copied wholesale.
# So thank guys!
#

import sys

if __name__ == '__main__':
    if sys.version_info >= (3, 0):
        print("\nThis is the Python 2 version of Python Koans, but you are " +
              "running it with Python 3 or newer!\n\n"
              "Did you accidentally use the wrong python script? \nTry:\n\n" +
              "    python contemplate_koans.py\n")
    else:
        if sys.version_info < (2, 7):
            print(
                "\n" +
                "********************************************************\n" +
                "WARNING:\n" +
                "This version of Python Koans was designed for " +
                "Python 2.7 or greater.\n" +
                "Your version of Python is older, so you may run into " +
                "problems!\n\n" + "But lets see how far we get...\n" +
                "********************************************************\n")

        from runner.mountain import Mountain

        Mountain().walk_the_optional_path(sys.argv)
Ejemplo n.º 11
0
 def setUp(self):
     path_to_enlightenment.koans = Mock()
     self.mountain = Mountain()
     self.mountain.stream.writeln = Mock()
Ejemplo n.º 12
0
# Python Koans is a port of Ruby Koans originally written by Jim Weirich
# and Joe O'brien of Edgecase. There are some differences and tweaks specific
# to the Python language, but a great deal of it has been copied wholesale.
# So thank guys!
#

import unittest
import sys

if __name__ == '__main__':
    if sys.version_info >= (3, 0):
        print("\nThis is the Python 2 version of Python Koans, but you are " +
              "running it with Python 3 or newer!\n\n"
              "Did you accidentally use the wrong python script? \nTry:\n\n" +
              "    python contemplate_koans.py\n")
    else:
        if sys.version_info < (2, 7):
            print(
                "\n" +
                "********************************************************\n" +
                "WARNING:\n" +
                "This version of Python Koans was designed for " +
                "Python 2.7 or greater.\n" +
                "Your version of Python is older, so you may run into " +
                "problems!\n\n" + "But lets see how far we get...\n" +
                "********************************************************\n")

        sid = int(sys.argv[1]) if len(sys.argv) > 1 else 1
        from runner.mountain import Mountain
        Mountain().session(sid)