How to use applications method in robotframework-appiumlibrary

Best Python code snippet using robotframework-appiumlibrary_python

availability_tests.py

Source:availability_tests.py Github

copy

Full Screen

...26 self.assertTrue(self.offer.is_available(test_date=self.end))27class TestAConsumptionFrequencyBasedConditionalOffer(TestCase):28 def setUp(self):29 self.offer = models.ConditionalOffer(max_global_applications=4)30 def test_is_available_with_no_applications(self):31 self.assertTrue(self.offer.is_available())32 def test_is_available_with_fewer_applications_than_max(self):33 self.offer.num_applications = 334 self.assertTrue(self.offer.is_available())35 def test_is_inactive_with_equal_applications_to_max(self):36 self.offer.num_applications = 437 self.assertFalse(self.offer.is_available())38 def test_is_inactive_with_more_applications_than_max(self):39 self.offer.num_applications = 440 self.assertFalse(self.offer.is_available())41 def test_restricts_number_of_applications_correctly_with_no_applications(self):42 self.assertEqual(4, self.offer.get_max_applications())43 def test_restricts_number_of_applications_correctly_with_fewer_applications_than_max(self):44 self.offer.num_applications = 345 self.assertEqual(1, self.offer.get_max_applications())46 def test_restricts_number_of_applications_correctly_with_more_applications_than_max(self):47 self.offer.num_applications = 548 self.assertEqual(0, self.offer.get_max_applications())49class TestAPerUserConditionalOffer(TestCase):50 def setUp(self):51 self.offer = models.ConditionalOffer(max_user_applications=1)52 self.user = G(User)53 def test_is_available_with_no_applications(self):54 self.assertTrue(self.offer.is_available())55 def test_max_applications_is_correct_when_no_applications(self):56 self.assertEqual(1, self.offer.get_max_applications(self.user))57 def test_max_applications_is_correct_when_equal_applications(self):58 order = create_order(user=self.user)59 G(OrderDiscount, order=order, offer_id=self.offer.id, frequency=1)60 self.assertEqual(0, self.offer.get_max_applications(self.user))61 def test_max_applications_is_correct_when_more_applications(self):62 order = create_order(user=self.user)63 G(OrderDiscount, order=order, offer_id=self.offer.id, frequency=5)64 self.assertEqual(0, self.offer.get_max_applications(self.user))65class TestCappedDiscountConditionalOffer(TestCase):66 def setUp(self):67 self.offer = models.ConditionalOffer(68 max_discount=D('100.00'),69 total_discount=D('0.00'))70 def test_is_available_when_below_threshold(self):71 self.assertTrue(self.offer.is_available())72 def test_is_inactive_when_on_threshold(self):73 self.offer.total_discount = self.offer.max_discount74 self.assertFalse(self.offer.is_available())75 def test_is_inactive_when_above_threshold(self):76 self.offer.total_discount = self.offer.max_discount + D('10.00')77 self.assertFalse(self.offer.is_available())78class TestASuspendedOffer(TestCase):...

Full Screen

Full Screen

urls.py

Source:urls.py Github

copy

Full Screen

1"""Webpage urls and handlers"""2from tornado.web import url3from models.home.handlers import HomeHandler4from models.users.handlers import RegisterHandler, LogoutHandler, LoginHandler, UserSettingsHandler5from models.applications.handlers import ApplicationsHandler, ApplicationDeletionHandler6from models.applications.handlers import ApplicationDeploymentDeletionHandler, ApplicationDeployer7from models.datasets.handlers import DatasetsHandler, DatasetsDeleteHandler8from models.pipelines.handlers import MLModelsHandler, MLModelsHandlerDelete9from models.pipelines.aws_deploy_handler import MLModelsAWSDeployHandler10from models.running_applications.handlers import RunningApplicationsHandler11from models.running_applications.handlers import VisualizeApplicationsHandler, DownloadDataHandler12from models.datasource_settings.handlers import DataSourceSettingsHandler13from models.datasource_settings.handlers import DataSourceSettingsHandlerDelete14URL_PATTERNS = [15 # Home16 url(r"/", HomeHandler, name="home"),17 # Auth18 url(r"/auth/register", RegisterHandler, name="register"),19 url(r"/auth/login", LoginHandler, name="login"),20 url(r"/auth/logout", LogoutHandler, name="logout"),21 # datasets22 url(r"/datasets", DatasetsHandler, name="datasets"),23 url(r"/datasets/delete", DatasetsDeleteHandler, name="datasets_delete"),24 # Pipelines25 url(r"/pipelines", MLModelsHandler, name="pipelines"),26 url(r"/pipelines/delete", MLModelsHandlerDelete, name="pipelines_delete"),27 url(r"/pipelines/deploy", MLModelsAWSDeployHandler, name="pipelines_deploy"),28 # Applications29 url(r"/applications", ApplicationsHandler, name="applications"),30 url(r"/applications/deploy", ApplicationDeployer, name="applications_deploy"),31 url(r"/applications/stop", ApplicationDeploymentDeletionHandler, name="applications_stop"),32 url(r"/applications/delete", ApplicationDeletionHandler, name="applications_delete"),33 # running Applications34 url(r"/running_applications", RunningApplicationsHandler, name="running_applications"),35 url(r"/running_applications/visualize", VisualizeApplicationsHandler,36 name="visualize_running_applications"),37 url(r"/running_applications/download", DownloadDataHandler, name="download_processed_data"),38 # User settings page39 url(r"/user_settings", UserSettingsHandler, name="user_settings"),40 # User twitter settings41 url(r"/datasource_settings", DataSourceSettingsHandler, name="datasource_settings"),42 url(r"/datasource_settings/delete", DataSourceSettingsHandlerDelete, name="datasource_settings_delete")...

Full Screen

Full Screen

settings.py

Source:settings.py Github

copy

Full Screen

1import logging2from pathlib import Path3from typing import Callable, Tuple4import tensorflow as tf5APP_NAME: str = "arch-id"6TIMESTAMP_FORMAT: str = r"%Y-%m-%d-%H:%M:%S"7DEFAULT_LOG_LEVEL = logging.INFO8SEED = 1234569BASE_DIR: Path = Path(__file__).parent.parent.absolute()10# Metrics11WEIGHTS = ["imagenet", "none"]12class BaseCNN:13 def __init__(14 self,15 name: str,16 base_model: tf.keras.Model,17 preprocess: Callable,18 image_size: Tuple[int, int],19 ):20 self.name = name21 self.base_model = base_model22 self.preprocess = preprocess23 self.image_size = image_size24BASE_CNNS = {25 tf.keras.applications.InceptionResNetV2.__name__: BaseCNN(26 name=tf.keras.applications.InceptionResNetV2.__name__,27 preprocess=tf.keras.applications.inception_resnet_v2.preprocess_input,28 base_model=tf.keras.applications.InceptionResNetV2,29 image_size=(224, 224),30 ),31 tf.keras.applications.InceptionV3.__name__: BaseCNN(32 name=tf.keras.applications.InceptionV3.__name__,33 preprocess=tf.keras.applications.inception_v3.preprocess_input,34 base_model=tf.keras.applications.InceptionV3,35 image_size=(224, 224),36 ),37 tf.keras.applications.ResNet152V2.__name__: BaseCNN(38 name=tf.keras.applications.ResNet152V2.__name__,39 preprocess=tf.keras.applications.resnet.preprocess_input,40 base_model=tf.keras.applications.ResNet152V2,41 image_size=(224, 224),42 ),43 tf.keras.applications.VGG19.__name__: BaseCNN(44 name=tf.keras.applications.VGG19.__name__,45 preprocess=tf.keras.applications.vgg19.preprocess_input,46 base_model=tf.keras.applications.VGG19,47 image_size=(224, 224),48 ),...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run robotframework-appiumlibrary automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful