예제 #1
0
 def test_foo(self):
     goz = Gozokia()
     goz.initialize()
     goz.set_io(input_type="value", output_type="value")
     value = "foo"
     self.assertEqual(goz.api(value), "bar")
     value = "foo"
     self.assertEqual(goz.api(value), "bar second")
     value = "foo"
     self.assertEqual(goz.api(value), "No rules. you said: foo")
예제 #2
0
 def test_foo(self):
     goz = Gozokia()
     goz.initialize()
     goz.set_io(input_type="value", output_type="value")
     value = "foo"
     self.assertEqual(goz.api(value), "bar")
     value = "foo"
     self.assertEqual(goz.api(value), "bar second")
     value = "foo"
     self.assertEqual(goz.api(value), "No rules. you said: foo")
예제 #3
0
 def test_greetings(self):
     goz = Gozokia()
     goz.rule(name='greeting', type=goz.RAISE_COND, rank=100)(GreetingRaise)
     goz.initialize()
     goz.set_io(input_type="value", output_type="value")
     value = "foo"
     self.assertEqual(goz.api(value), "bar")
     value = "Bacon"
     self.assertEqual(goz.api(value), "No rules. you said: Bacon")
     value = "Hi"
     self.assertEqual(goz.api(value), "Hi, who are you?")
     value = "i am Alberto"
     self.assertEqual(goz.api(value), "Hi, alberto")
예제 #4
0
 def test_greetings(self):
     goz = Gozokia()
     goz.rule(name='greeting', type=goz.RAISE_COND, rank=100)(GreetingRaise)
     goz.initialize()
     goz.set_io(input_type="value", output_type="value")
     value = "foo"
     self.assertEqual(goz.api(value), "bar")
     value = "Bacon"
     self.assertEqual(goz.api(value), "No rules. you said: Bacon")
     value = "Hi"
     self.assertEqual(goz.api(value), "Hi, who are you?")
     value = "i am Alberto"
     self.assertEqual(goz.api(value), "Hi, alberto")
예제 #5
0
 def test_value(self):
     gozokia = Gozokia()
     gozokia.set_io(input_type="value")
     value = "Hola hola!"
     self.assertEqual(gozokia.io.listen(value=value), value)
예제 #6
0
# encoding: utf-8
import sys
import os
from gozokia import Gozokia
os.environ.setdefault("GOZOKIA_SETTINGS_MODULE", "settings")

goz = Gozokia()
goz.initialize()
goz.set_io(input_type="terminal_txt", output_type="terminal_txt")
goz.console()
예제 #7
0
 def test_value(self):
     gozokia = Gozokia()
     gozokia.set_io(input_type="value")
     value = "Hola hola!"
     self.assertEqual(gozokia.io.listen(value=value), value)