Commits

Ronny Pfannschmidt committed 130c72e

more explicit doctype

  • Participants
  • Parent commits ca1159f

Comments (0)

Files changed (2)

File glas_process/model.py

     __rerp__ = FormatRepr('<Task {belongs_to} {status}>')
 
 class Step(Document):
+    doc_type = 'glas_process:step'
+
     __repr__ = FormatRepr('<Step of {task} started {started:%Y-%m-%d}>')
 
     task = StringProperty()
     finished = DateTimeProperty(default=None)
 
 class Event(Document):
+    doc_type = 'glas_process:event'
     __repr__ = FormatRepr(r'<Event {step} {index}>')
 
     step = StringProperty()

File testing/test_events.py

     step = prepare_subprocess(procdir, ['ls'], _id='the_ls')
     procdir.run(step)
     checks = [
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', 'prepared'),
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', "running"),
         ('line', 'somefile\n'),
         ('returncode', 0),
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', "complete"),
     ]
     check_events(procdir, checks)
     step = prepare_subprocess(procdir, ['false'])
     procdir.run(step)
     checks = [
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', 'prepared'),
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', "running"),
         ('returncode', 1),
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', "failed"),
     ]
     check_events(procdir, checks)
     doc = prepare_python(procdir, 'print 1\n')
     procdir.run(doc)
     checks = [
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', 'prepared'),
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', "running"),
         ('line', '1\n'),
         ('returncode', 0),
-        ('doc_type', "Step",
+        ('doc_type', "glas_process:step",
          'status', "complete"),
     ]
     check_events(procdir, checks)