Showing 3 of 3 files from the diff.
Newly tracked file
que/__about__.py changed.
Newly tracked file
que/query.py changed.
Newly tracked file
tests/test_query.py changed.

@@ -1,7 +1,7 @@
Loading
1 1
__title__ = "que"
2 2
__description__ = "Que: SQL for Sneks 🐍"
3 3
__url__ = "https://github.com/seandstewart/que"
4 -
__version__ = "1.1.0"
4 +
__version__ = "1.1.1"
5 5
__author__ = "Sean Stewart"
6 6
__author_email__ = "sean_stewart@me.com"
7 7
__license__ = "MIT"

@@ -171,7 +171,9 @@
Loading
171 171
        args.append(self.field)
172 172
        fmt = f"{style}"
173 173
        if style in NameParamStyle:
174 -
            fmt = fmt.format(f"{self.prefix}{self.field.name}")
174 +
            name = f"{self.prefix}{self.field.name}"
175 +
            fmt = fmt.format(name)
176 +
            args[-1] = dataclasses.replace(self.field, name=name)
175 177
        elif style in NumParamStyle:
176 178
            fmt = fmt.format(len(args))
177 179
        return f"{self.field.name} {self.opcode} {fmt}", args

@@ -111,31 +111,37 @@
Loading
111 111
def test_update_default_style(default_update):
112 112
    sql, args = default_update.to_sql()
113 113
    assert sql == "UPDATE\n  bar.foo\nSET\n  foo = :1\nWHERE\n  foo = :2\n"
114 +
    assert len(args) == 2
114 115
115 116
116 117
def test_update_dollar_style(default_update):
117 118
    sql, args = default_update.to_sql(que.NumParamStyle.DOL)
118 119
    assert sql == "UPDATE\n  bar.foo\nSET\n  foo = $1\nWHERE\n  foo = $2\n"
120 +
    assert len(args) == 2
119 121
120 122
121 123
def test_update_name_style(default_update):
122 124
    sql, args = default_update.to_sql(que.NameParamStyle.NAME)
123 125
    assert sql == "UPDATE\n  bar.foo\nSET\n  foo = :colfoo\nWHERE\n  foo = :foo\n"
126 +
    assert set(args) == {"colfoo", "foo"}
124 127
125 128
126 129
def test_update_pyformat_style(default_update):
127 130
    sql, args = default_update.to_sql(que.NameParamStyle.PYFM)
128 131
    assert sql == "UPDATE\n  bar.foo\nSET\n  foo = %(colfoo)s\nWHERE\n  foo = %(foo)s\n"
132 +
    assert set(args) == {"colfoo", "foo"}
129 133
130 134
131 135
def test_update_format_style(default_update):
132 136
    sql, args = default_update.to_sql(que.BasicParamStyle.FM)
133 137
    assert sql == "UPDATE\n  bar.foo\nSET\n  foo = %s\nWHERE\n  foo = %s\n"
138 +
    assert len(args) == 2
134 139
135 140
136 141
def test_update_qmark_style(default_update):
137 142
    sql, args = default_update.to_sql(que.BasicParamStyle.QM)
138 143
    assert sql == "UPDATE\n  bar.foo\nSET\n  foo = ?\nWHERE\n  foo = ?\n"
144 +
    assert len(args) == 2
139 145
140 146
141 147
def test_update_get_returning(default_update):
@@ -152,31 +158,37 @@
Loading
152 158
def test_insert_inject_columns(default_insert):
153 159
    sql, args = default_insert.to_sql(inject_columns=True)
154 160
    assert sql == "INSERT INTO\n  bar.foo (foo)\nVALUES\n  (:1)\n"
161 +
    assert len(args) == 1
155 162
156 163
157 164
def test_insert_dollar_style(default_insert):
158 165
    sql, args = default_insert.to_sql(que.NumParamStyle.DOL)
159 166
    assert sql == "INSERT INTO\n  bar.foo ($1)\nVALUES\n  ($2)\n"
167 +
    assert len(args) == 2
160 168
161 169
162 170
def test_insert_name_style(default_insert):
163 171
    sql, args = default_insert.to_sql(que.NameParamStyle.NAME)
164 172
    assert sql == "INSERT INTO\n  bar.foo (:colfoo)\nVALUES\n  (:valfoo)\n"
173 +
    assert set(args) == {"colfoo", "valfoo"}
165 174
166 175
167 176
def test_insert_pyformat_style(default_insert):
168 177
    sql, args = default_insert.to_sql(que.NameParamStyle.PYFM)
169 178
    assert sql == "INSERT INTO\n  bar.foo (%(colfoo)s)\nVALUES\n  (%(valfoo)s)\n"
179 +
    assert set(args) == {"colfoo", "valfoo"}
170 180
171 181
172 182
def test_insert_format_style(default_insert):
173 183
    sql, args = default_insert.to_sql(que.BasicParamStyle.FM)
174 184
    assert sql == "INSERT INTO\n  bar.foo (%s)\nVALUES\n  (%s)\n"
185 +
    assert len(args) == 2
175 186
176 187
177 188
def test_insert_qmark_style(default_insert):
178 189
    sql, args = default_insert.to_sql(que.BasicParamStyle.QM)
179 190
    assert sql == "INSERT INTO\n  bar.foo (?)\nVALUES\n  (?)\n"
191 +
    assert len(args) == 2
180 192
181 193
182 194
def test_insert_get_returning(default_insert):
Files Coverage
que 100.00%
tests/test_query.py 100.00%
Project Totals (5 files) 100.00%
Notifications are pending CI completion. Waiting for GitHub's status webhook to queue notifications. Push notifications now.
26.4
TRAVIS_PYTHON_VERSION=nightly
TRAVIS_OS_NAME=linux
26.1
TRAVIS_PYTHON_VERSION=3.7-dev
TRAVIS_OS_NAME=linux
27.2
TRAVIS_PYTHON_VERSION=3.8-dev
TRAVIS_OS_NAME=linux
26.2
TRAVIS_PYTHON_VERSION=3.8-dev
TRAVIS_OS_NAME=linux
27.3
TRAVIS_PYTHON_VERSION=3.7
TRAVIS_OS_NAME=linux
27.4
TRAVIS_PYTHON_VERSION=nightly
TRAVIS_OS_NAME=linux
27.1
TRAVIS_PYTHON_VERSION=3.7-dev
TRAVIS_OS_NAME=linux

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading