~jplacerda/zeitgeist/784850

« back to all changes in this revision

Viewing changes to test/engine-test.py

  • Committer: Mikkel Kamstrup Erlandsen
  • Date: 2010-04-28 19:11:01 UTC
  • mfrom: (1322.1.103 ontology_definition)
  • Revision ID: kamstrup@hardback-20100428191101-9pmau6vlqmna0fow
Merge lp:~zeitgeist/zeitgeist/ontology_definition. This introduces some slight API breaks on the Python level and maybe the need for a DB version upgrade to reflect new URIs here and there. We will tackle these issues in trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
                
175
175
                subject = Subject()
176
176
                subject.uri = "file:///tmp/file.txt"
177
 
                subject.manifestation = Manifestation.FILE
 
177
                subject.manifestation = Manifestation.FILE_DATA_OBJECT
178
178
                subject.interpretation = Interpretation.DOCUMENT
179
179
                subject.origin = "test://"
180
180
                subject.mimetype = "text/plain"
235
235
                self.testSingleInsertGet()
236
236
                result = self.engine.find_eventids(
237
237
                        TimeRange.always(),
238
 
                        [Event.new_for_values(interpretation=Interpretation.CLOSE_EVENT)],
 
238
                        [Event.new_for_values(interpretation=Interpretation.LEAVE_EVENT)],
239
239
                        StorageState.Any, 0, 0)
240
240
                self.assertEquals(0, len(result))
241
241
 
414
414
        def testInsertSubjectOptionalAttributes(self):
415
415
                ev = Event.new_for_values(
416
416
                        timestamp=123,
417
 
                        interpretation=Interpretation.VISIT_EVENT.uri,
418
 
                        manifestation=Manifestation.USER_ACTIVITY.uri,
 
417
                        interpretation=Interpretation.ACCESS_EVENT,
 
418
                        manifestation=Manifestation.USER_ACTIVITY,
419
419
                        actor="Freak Mamma"
420
420
                )
421
421
                subj = Subject.new_for_values(
422
422
                        uri="void://foobar",
423
 
                        interpretation=Interpretation.DOCUMENT.uri,
424
 
                        manifestation=Manifestation.FILE.uri,
 
423
                        interpretation=Interpretation.DOCUMENT,
 
424
                        manifestation=Manifestation.FILE_DATA_OBJECT,
425
425
                        )
426
426
                ev.append_subject(subj)
427
427
                
431
431
        
432
432
        def testEventWithoutSubject(self):
433
433
                ev = Event.new_for_values(timestamp=123,
434
 
                                        interpretation=Interpretation.VISIT_EVENT.uri,
435
 
                                        manifestation=Manifestation.USER_ACTIVITY.uri,
 
434
                                        interpretation=Interpretation.ACCESS_EVENT,
 
435
                                        manifestation=Manifestation.USER_ACTIVITY,
436
436
                                        actor="Freak Mamma")
437
437
                ids = self.engine.insert_events([ev,])
438
438
                self.assertEquals(len(ids), 1)
602
602
                subject = Subject()
603
603
                ev.actor = "application:///firefox.desktop"
604
604
                ev.manifestation = Manifestation.USER_ACTIVITY
605
 
                ev.interpretation = Interpretation.VISIT_EVENT
 
605
                ev.interpretation = Interpretation.ACCESS_EVENT
606
606
                subject.uri = "http://www.google.com"
607
 
                subject.interpretation = Interpretation.UNKNOWN
608
 
                subject.manifestation = Manifestation.WEB_HISTORY
 
607
                subject.interpretation = Interpretation #InterPretation.UNKNOWN
 
608
                subject.manifestation = Manifestation #Manifestation.WEB_HISTORY
609
609
                subject.text = None
610
610
                subject.mimetype = "text/html"
611
611
                subject.origin = None