Skip to content

Commit

Permalink
Merge pull request #439 from plotly/requirements
Browse files Browse the repository at this point in the history
Refactor requirements.txt
  • Loading branch information
T4rk1n authored Oct 30, 2018
2 parents 5ac9a3b + da9da91 commit 61b0545
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 59 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
docker:
- image: circleci/python:2.7-stretch-browsers
environment:
REQUIREMENTS_FILE: dev-requirements.txt
REQUIREMENTS_FILE: .circleci/requirements/dev-requirements.txt
PYLINTRC: .pylintrc

steps:
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
docker:
- image: circleci/python:3.6-stretch-browsers
environment:
REQUIREMENTS_FILE: dev-requirements.txt
REQUIREMENTS_FILE: .circleci/requirements/dev-requirements.txt
PYLINTRC: .pylintrc
PERCY_ENABLE: 0

Expand All @@ -67,7 +67,7 @@ jobs:
docker:
- image: circleci/python:3.7-stretch-browsers
environment:
REQUIREMENTS_FILE: dev-requirements-py37.txt
REQUIREMENTS_FILE: .circleci/requirements/dev-requirements-py37.txt
PYLINTRC: .pylintrc37
PERCY_ENABLE: 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dash_core_components>=0.27.2
dash_core_components>=0.35.1
dash_html_components==0.12.0rc3
dash-flow-example==0.0.3
dash-dangerously-set-inner-html
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dash_core_components>=0.27.2
dash_core_components>=0.35.1
dash_html_components>=0.12.0rc3
dash_flow_example==0.0.3
dash-dangerously-set-inner-html
Expand Down
47 changes: 0 additions & 47 deletions requirements.txt

This file was deleted.

17 changes: 17 additions & 0 deletions tests/IntegrationTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
from selenium import webdriver
import percy

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

TIMEOUT = 20


class IntegrationTests(unittest.TestCase):

Expand All @@ -15,6 +21,17 @@ def percy_snapshot(cls, name=''):
name=snapshot_name
)

def wait_for_element_by_css_selector(self, selector):
return WebDriverWait(self.driver, TIMEOUT).until(
EC.presence_of_element_located((By.CSS_SELECTOR, selector))
)

def wait_for_text_to_equal(self, selector, assertion_text):
return WebDriverWait(self.driver, TIMEOUT).until(
EC.text_to_be_present_in_element((By.CSS_SELECTOR, selector),
assertion_text)
)

@classmethod
def setUpClass(cls):
super(IntegrationTests, cls).setUpClass()
Expand Down
11 changes: 4 additions & 7 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import dash
import time

from dash.dependencies import Input, Output
from dash.dependencies import Input, Output, State
from dash.exceptions import PreventUpdate
from .IntegrationTests import IntegrationTests
from .utils import assert_clean_console, invincible, wait_for
Expand Down Expand Up @@ -61,8 +61,7 @@ def update_output(value):

input1.send_keys('hello world')

output1 = lambda: self.wait_for_element_by_id('output-1')
wait_for(lambda: output1().text == 'hello world')
output1 = self.wait_for_text_to_equal('#output-1', 'hello world')
self.percy_snapshot(name='simple-callback-2')

self.assertEqual(
Expand Down Expand Up @@ -106,17 +105,15 @@ def update_text(data):
return data

self.startServer(app)
output1 = self.wait_for_element_by_id('output-1')
wait_for(lambda: output1.text == 'initial value')
output1 = self.wait_for_text_to_equal('#output-1', 'initial value')
self.percy_snapshot(name='wildcard-callback-1')

input1 = self.wait_for_element_by_id('input')
input1.clear()

input1.send_keys('hello world')

output1 = lambda: self.wait_for_element_by_id('output-1')
wait_for(lambda: output1().text == 'hello world')
output1 = self.wait_for_text_to_equal('#output-1', 'hello world')
self.percy_snapshot(name='wildcard-callback-2')

self.assertEqual(
Expand Down

0 comments on commit 61b0545

Please sign in to comment.