Exemplo n.º 1
0
 def test_returnValidPositionsInComment_ShouldReturnListOfValidPositionObjects_When_ValidPositionsAreFound(
         self):
     mockPosition = createValidPositionObjects("MSFT", "$179C", "06/19")
     comment = "Money $MSFT printer $179C go 06/19 Brrrr"
     actualPosition = redditScraper.returnValidPositionsInComment(comment)
     self.assertEqual(mockPosition.ticker, actualPosition[0].ticker)
     self.assertEqual(mockPosition.price, actualPosition[0].price)
     self.assertEqual(mockPosition.strikeDate, actualPosition[0].strikeDate)
     self.assertEqual(mockPosition.isCall, actualPosition[0].isCall)
Exemplo n.º 2
0
 def test_returnValidPositionsInComment_ShouldReturnMultiplePositions_When_MultipleValidPositions(
         self):
     comment = "AAPL MSFT  HBAN Money printer 45C $179C 11 go 06/19 2/7c 4/18P Brrrr"
     actualPosition = redditScraper.returnValidPositionsInComment(comment)
     self.assertEqual(3, len(actualPosition))
Exemplo n.º 3
0
 def test_returnValidPositionsInComment_ShouldReturnEmptyList_When_MismatchOfTicker(
         self):
     comment = "AAPL Money $MSFT printer $179C go HBAN 06/19 Brrrr"
     actualPosition = redditScraper.returnValidPositionsInComment(comment)
     self.assertEqual([], actualPosition)
Exemplo n.º 4
0
 def test_returnValidPositionsInComment_ShouldReturnEmptyList_When_MismatchOfDate(
         self):
     comment = "7/13 Money 2/11C printer $179C MSFT go 06/19 Brrrr"
     actualPosition = redditScraper.returnValidPositionsInComment(comment)
     self.assertEqual([], actualPosition)
Exemplo n.º 5
0
 def test_returnValidPositionsInComment_ShouldReturnEmptyList_When_MismatchOfPrice(
         self):
     comment = "300C Money $23.30 $MSFT printer $179C go 06/19 Brrrr"
     actualPosition = redditScraper.returnValidPositionsInComment(comment)
     self.assertEqual([], actualPosition)