Skip to content

Instantly share code, notes, and snippets.

View ssttuu's full-sized avatar

Stu Schwartz ssttuu

  • London
  • 23:52 (UTC +01:00)
View GitHub Profile
import os
def lowest_common_paths(path_tree, cur_path='/', depth=0, branch_limit=None, depth_limit=None):
"""
Args:
path_tree (dict): nested dictioary representing path structure
branch_tolerance (int): tolerance how many branches before we call this a main folder
depth_limit (int):
Returns (str): list of paths that are lowest common denominators
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
Loaded integration_test_helper.py. Testing API_BASE_URL: https://api.bam-x.com/api/v0
api.views.auction_test_run.api_auction_test_run ... ok
api.views.test_endpoint.api_smoke_test ... ok
test_get_endpoint (api.test.test_cases.integration.auction_distribution.test_auction_distribution_view.TestAuctionDistributionView) ... ok
test_post_endpoint (api.test.test_cases.integration.auction_distribution.test_auction_distribution_view.TestAuctionDistributionView) ... ok
test_updates_bids (api.test.test_cases.integration.merchant_bid.test_merchant_bid_batch_update_endpoint.TestApiBatchUpdateMerchantBid) ... ok
test_creates_live_bid_if_no_status_specified (api.test.test_cases.integration.merchant_bid.test_merchant_bid_batch_update_endpoint.TestBatchCreateNewBids) ... ok
test_creates_new_bids (api.test.test_cases.integration.merchant_bid.test_merchant_bid_batch_update_endpoint.TestBatchCreateNewBids) ... ok
test_does_nothing_if_no_bid_cpc (api.test
registered_methods = {}
class GetRegisteredMethodsMetaclass(type):
def __getattr__(self, item):
func = registered_methods.get(item)
if func:
return func
#!/usr/bin/env bash
yaml2json='python -c "import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)"'
# Deploy Compute Service
service_response=$(gcloud service-management deploy compute.pb api_config.yaml --format json)
service_id=$(echo ${service_response} | jq '.serviceConfig.id')
service_name=$(echo ${service_response} | jq '.serviceConfig.name')