#!/usr/bin/env python
# -*- coding: utf-8 -*-

from runner.koan import *


class AboutTrueAndFalse(Koan):
    def truth_value(self, condition):
        if condition:
            return 'true stuff'
        else:
            return 'false stuff'

    def test_true_is_treated_as_true(self):
        self.assertEqual(__, self.truth_value(True))

    def test_false_is_treated_as_false(self):
        self.assertEqual(__, self.truth_value(False))

    def test_none_is_treated_as_false(self):
        self.assertEqual(__, self.truth_value(None))

    def test_zero_is_treated_as_false(self):
        self.assertEqual(__, self.truth_value(0))

    def test_empty_collections_are_treated_as_false(self):
        self.assertEqual(__, self.truth_value([]))
        self.assertEqual(__, self.truth_value(()))
        self.assertEqual(__, self.truth_value({}))
        self.assertEqual(__, self.truth_value(set()))

    def test_blank_strings_are_treated_as_false(self):
        self.assertEqual(__, self.truth_value(""))

    def test_everything_else_is_treated_as_true(self):
        self.assertEqual(__, self.truth_value(1))
        self.assertEqual(__, self.truth_value([0]))
        self.assertEqual(__, self.truth_value((0,)))
        self.assertEqual(
            __,
            self.truth_value("Python is named after Monty Python"))
        self.assertEqual(__, self.truth_value(' '))
        self.assertEqual(__, self.truth_value('0'))

@@ -300,34 +300,44 @@
 elf.assertEqual(
-__
+'true stuff'
 , self.truth_val
@@ -410,34 +410,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -521,34 +521,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -631,34 +631,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -752,34 +752,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -814,34 +814,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -876,34 +876,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -938,34 +938,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -1059,34 +1059,45 @@
 elf.assertEqual(
-__
+'false stuff'
 , self.truth_val
@@ -1177,34 +1177,44 @@
 elf.assertEqual(
-__
+'true stuff'
 , self.truth_val
@@ -1237,34 +1237,44 @@
 elf.assertEqual(
-__
+'true stuff'
 , self.truth_val
@@ -1299,34 +1299,44 @@
 elf.assertEqual(
-__
+'true stuff'
 , self.truth_val
@@ -1383,18 +1383,28 @@
         
-__
+'true stuff'
 ,%0A      
@@ -1482,34 +1482,44 @@
 elf.assertEqual(
-__
+'true stuff'
 , self.truth_val
@@ -1556,10 +1556,20 @@
 ual(
-__
+'true stuff'
 , se

Finishes about true and false