Exemplo n.º 1
0
 def testListMostRecentSmallFile(self):
     writeFile(filename, "856-938-4220", "red", red_message)
     writeFile(filename, "856-938-4220", "blue", blue_message)
     writeFile(filename, "856-938-4220", "green", green_message)
     expectedColors = ["red", "blue", "green"]
     self.assertListEqual(expectedColors, mostRecentColors(filename))
     os.remove(filePath)
Exemplo n.º 2
0
 def testListMostRecentEmptyFile(self):
     expectedColors = []
     self.assertListEqual(expectedColors, mostRecentColors(filename))
     try:
         os.remove(filePath)
     except FileNotFoundError:
         return
Exemplo n.º 3
0
import plotly.plotly as py
import plotly.graph_objs as go

from data_writer import mostRecentColors
import plotly
plotly.tools.set_credentials_file(username='******',
                                  api_key='Q833pymOHavNzWGFDruA')
filename = "data.csv"

colors = mostRecentColors(filename)
trace = go.Table(header=dict(values=["Colors"]),
                 cells=dict(values=[mostRecentColors(filename)]))
data = [trace]
py.plot(data, filename='Most Recent Colors Chosen')
Exemplo n.º 4
0
def get_most_recent():
    return mostRecentColors(file)
Exemplo n.º 5
0
 def testListMostRecent(self):
     fileCreator.createTestFile(self)
     expectedColors = ['yellow', 'blue', 'red', 'white', 'blue']
     self.assertListEqual(expectedColors, mostRecentColors(filename))
     os.remove(filePath)