-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Very beginning of the base counter implementation.
- Loading branch information
Sean O'Connor
committed
Feb 16, 2012
1 parent
8480def
commit d2db257
Showing
7 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Albertson.egg-info | ||
.coverage | ||
tests/config.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import boto | ||
|
||
|
||
class Counter(object): | ||
''' | ||
Base counter class that can be used directly or overwritten as needed. | ||
''' | ||
|
||
def __init__(self, aws_access_key=None, aws_secret_key=None): | ||
self.conn = self.get_conn(aws_access_key, aws_secret_key) | ||
|
||
def get_conn(self, aws_access_key=None, aws_secret_key=None): | ||
return boto.connect_dynamodb( | ||
aws_access_key_id=aws_access_key, | ||
aws_secret_access_key=aws_secret_key, | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,4 @@ | |
detailed-errors=1 | ||
with-coverage=1 | ||
cover-package=albertson | ||
pdb=1 | ||
pdb-failures=1 | ||
tc-file=tests/config.ini |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import unittest | ||
|
||
from testconfig import config | ||
|
||
from albertson.base import Counter | ||
|
||
|
||
class BaseCounterTests(unittest.TestCase): | ||
|
||
def test_base_init(self): | ||
counter = Counter( | ||
aws_access_key=config['aws']['access_key'], | ||
aws_secret_key=config['aws']['secret_key'], | ||
) | ||
|
||
counter.conn.list_tables() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[aws] | ||
access_key=YOUR_AWS_ACCESS_KEY_ID | ||
secret_key=YOUR_AWS_SECRET_KEY |