<commit_before>Class {
	#name : #TrackAlongExamples,
	#superclass : #Object,
	#category : #'TrackAlong-TrackAlong'
}

{ #category : #accessing }
TrackAlongExamples >> doSomethingWithTrackingTurnedOnFromDevice [
	"          <Data name=""Event"">
            <value>Tracking turned on from device.</value>
          </Data>"

	<gtExample>
	self assert: false
]

{ #category : #accessing }
TrackAlongExamples >> pullFromDeLorme [
	<gtExample>
	<gtDescription: 'should get latest events'>
	"TODO: make this pull from stored archive."
	| points flightTrack pilotName |
	
"https://share.delorme.com/feed/Share/KurtThams?d1=2020-08-22T03:07Z&d2=2020-08-25T20:04Z"
	points := TrackAlong
		poll: 'KurtThams'
		oldest: '2020-08-25T00:47:45Z'
		newest: '2020-08-25T00:49:45Z'.
	self assert: points size equals: 2.
	self assert: (points first differentDataPoint: points last).
	pilotName := points first pilotName.
	self assert: pilotName equals: '<NAME>'.
	flightTrack := FlightTrack new pilot: (pilotName).
	points do: [ :point | flightTrack add: point ].
	self assert: flightTrack size equals: 2.
	^ flightTrack
]

{ #category : #accessing }
TrackAlongExamples >> rePullFromDeLorme [
	<gtExample>
	<gtDescription: 'should ignore duplicate events'>
	"TODO: Make this pull from archived event data"
	| points flightTrack |
	flightTrack := self pullFromDeLorme.

	"Do it again for same period; should be no duplicates"
	points := TrackAlong
		poll: 'KurtThams'
		oldest: '2020-08-25T00:47:45Z'
		newest: '2020-08-25T00:49:45Z'.
	self assert: points size equals: 2.
	points do: [ :point | flightTrack add: point ].
	self assert: flightTrack size equals: 2.
	self assert: flightTrack trackLogger recordings size equals: 2.
	self
		assert:
			(flightTrack trackLogger recordings first message<commit_msg>Fix test cases for dup detection<commit_after>Class {
	#name : #TrackAlongExamples,
	#superclass : #Object,
	#category : #'TrackAlong-TrackAlong'
}

{ #category : #accessing }
TrackAlongExamples >> doSomethingWithTrackingTurnedOnFromDevice [
	"          <Data name=""Event"">
            <value>Tracking turned on from device.</value>
          </Data>"

	<gtExample>
	self assert: false
]

{ #category : #accessing }
TrackAlongExamples >> pullFromDeLorme [
	<gtExample>
	<gtDescription: 'should get latest events'>
	"TODO: make this pull from stored archive."
	| points flightTrack pilotName |
	
"https://share.delorme.com/feed/Share/KurtThams?d1=2020-08-22T03:07Z&d2=2020-08-25T20:04Z"
	points := TrackAlong
		poll: 'KurtThams'
		oldest: '2020-08-25T00:47:45Z'
		newest: '2020-08-25T00:49:45Z'.
	self assert: points size equals: 2.
	self assert: (points first differentDataPoint: points last).
	pilotName := points first pilotName.
	self assert: pilotName equals: '<NAME>'.
	flightTrack := FlightTrack new pilot: (pilotName).
	self assert: flightTrack trackLogger recordings size equals: 0.
	points do: [ :point | flightTrack add: point ].
	self assert: flightTrack size equals: 2.
	self assert: (flightTrack trackLogger recordings size) > 10.
	^ flightTrack
]

{ #category : #accessing }
TrackAlongExamples >> rePullFromDeLorme [
	<gtExample>
	<gtDescription: 'should ignore duplicate events'>
	"TODO: Make this pull from archived event data"
	| points flightTrack |
	flightTrack := self pullFromDeLorme.
	self assert: flightTrack size equals: 2.

	"Do it again for same period; should be no duplicates"
	points := TrackAlong
		poll: 'KurtThams'
		oldest: '2020-08-25T00:47:45Z'
		newest: '2020-08-25T00:49:45Z'.
	self assert: points size equals: 2.
	points do: [ :point | flightTrack add: point ].
	self assert: flightTrack size equals: 2.
	self
		assert:
			(flightTrack trackLogger recordings last message
{'fraction_non_alphanumeric': 0.11567567567567567, 'fraction_numerical': 0.047837837837837835, 'mean_word_length': 4.442647058823529, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 36, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1875692', 'n_tokens_mistral': 1401, 'n_tokens_neox': 1225, 'n_words': 349}