Exemple #1
0
 def red_spec(self, title):
     string = "    %s" % (name_convertion(title))
     if not self.dotted:
         self.writer.writeln(string, 'red')
     else:
         self.writer.println('F')
         self.writer.flush()
Exemple #2
0
 def green_spec(self, title):
     string = "    %s" % (name_convertion(title))
     if not self.dotted:
         self.writer.writeln(string, 'green')
     else:
         self.writer.println('.')
         self.writer.flush()
Exemple #3
0
 def translate_exc_line(self, lines):
     if self.error or self.debug: return lines
     valid_file_name   = re.compile(r'\s+File\s+(.*)case[_a-z]\w*\.py', re.IGNORECASE)
     valid_method_name = re.compile(r'(.*)\s+in\s+it_[_a-z]\w*', re.IGNORECASE)
     valid_it_case     = re.compile(r'it_[_a-z]\w*', re.IGNORECASE)
     rewritten_lines   = []
     for line in lines:
         if valid_file_name.match(line) and valid_method_name.match(line):
             it_method = valid_it_case.search(line)
             if it_method:
                 rewrite_it = name_convertion(it_method.group(), capitalize=False)
                 line = re.sub(valid_it_case, rewrite_it, line)
             rewritten_lines.append(line)
         else:
             rewritten_lines.append(line)
     return rewritten_lines
Exemple #4
0
 def out_case(self, title):
     if not self.dotted:
         self.writer.println("\n\n%s" % name_convertion(title))
Exemple #5
0
 def _output_profiles(self, data):
     str_time = str(data[0])[:10]
     elapsed  = self.writer.bold(str_time)
     case     = self.writer.green(name_convertion(data[1]))
     message  = "%s - %s" % (elapsed, case)
     self.writer.writeln(message)
 def reportinfo(self):
     describe = "describe %s" % name_convertion(self.case.__class__.__name__)
     it = name_convertion(self.name, capitalize=False)
     describe_and_it = "%s ==>> %s" % (describe, it)
     return self.fspath, 0, describe_and_it
Exemple #7
0
from konira import util


describe "name convertion":


    it "replaces underscore with whitespace":
        name = "a_white_space_string"
        assert util.name_convertion(name) == 'A white space string'


    it "removes whitespaces from outer string":
        name = " a_white_space_string "
        assert util.name_convertion(name) == 'a white space string'


    it "removes case from a name string":
        name = "Case_foo_bar"
        assert util.name_convertion(name) == 'foo bar'


    it "does not remove case if not uppercase":
        name = "case_foo_bar"
        assert util.name_convertion(name) == 'Case foo bar'



describe "get class name":


    it "returns itself when it str does not start with case":